diff --git a/src/bbs.c b/src/bbs.c index 870764e..cdf383f 100644 --- a/src/bbs.c +++ b/src/bbs.c @@ -1022,7 +1022,7 @@ tryagain: } void do_logout() { - char buffer[256]; + char buffer[PATH_MAX]; struct stat s; lua_State *L; int ret = 0; diff --git a/src/strings.c b/src/strings.c index f08ef2c..ece3ee1 100644 --- a/src/strings.c +++ b/src/strings.c @@ -10,7 +10,7 @@ char **strings; int string_count; 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'; } }