Fix a couple of bugs

This commit is contained in:
Andrew Pamment 2018-02-10 14:59:10 +10:00
parent 16403f14ad
commit d5d61a8cc6
2 changed files with 2 additions and 2 deletions

View File

@ -1022,7 +1022,7 @@ tryagain:
} }
void do_logout() { void do_logout() {
char buffer[256]; char buffer[PATH_MAX];
struct stat s; struct stat s;
lua_State *L; lua_State *L;
int ret = 0; int ret = 0;

View File

@ -10,7 +10,7 @@ char **strings;
int string_count; int string_count;
void chomp(char *string) { void chomp(char *string) {
while ((string[strlen(string)-1] == '\r' || string[strlen(string)-1] == '\n') && strlen(string)) { while (strlen(string) && (string[strlen(string)-1] == '\r' || string[strlen(string)-1] == '\n')) {
string[strlen(string)-1] = '\0'; string[strlen(string)-1] = '\0';
} }
} }