X-Git-Url: https://git.tokkee.org/?a=blobdiff_plain;f=server-info.c;h=c1c073b2f05a48772a45602cdc711eef6e211695;hb=3c076dbe3cffee3b5cbf34759d627c47a417c145;hp=a051e49a9ea2f605bdc278394de731ff4c55e627;hpb=bd8ff616c998da8b08bd59b47644408048b3016d;p=git.git diff --git a/server-info.c b/server-info.c index a051e49a9..c1c073b2f 100644 --- a/server-info.c +++ b/server-info.c @@ -101,7 +101,7 @@ static int read_pack_info_file(const char *infofile) while (fgets(line, sizeof(line), fp)) { int len = strlen(line); - if (line[len-1] == '\n') + if (len && line[len-1] == '\n') line[--len] = 0; if (!len)