X-Git-Url: https://git.octo.it/?a=blobdiff_plain;f=stripspace.c;h=65a6346452bb924d203724a9bfeb1c4ed98025e1;hb=fd7e9fb7ae206a64b87c7faecfc88716e98a7577;hp=dee1ef06edae928c6103fea6b21812de22140a6e;hpb=02376287ffd8b37ea7622fd4b61d654855112e75;p=git.git diff --git a/stripspace.c b/stripspace.c index dee1ef06..65a63464 100644 --- a/stripspace.c +++ b/stripspace.c @@ -12,7 +12,9 @@ static int cleanup(char *line) { int len = strlen(line); - if (len > 1 && line[len-1] == '\n') { + if (len && line[len-1] == '\n') { + if (len == 1) + return 0; do { unsigned char c = line[len-2]; if (!isspace(c))