X-Git-Url: https://asedeno.scripts.mit.edu/gitweb/?a=blobdiff_plain;f=builtin-fetch--tool.c;h=ed60847d9fcd0ad8803c432af8d0bc2dd3567768;hb=d577bc58a3424f4d0d7f7c8094753b92cb7cb823;hp=6a78517958567e9dee4bfb00236caf5c3d1c3d67;hpb=03800743156fe4f331a10c0983b9d633bed3a687;p=git.git diff --git a/builtin-fetch--tool.c b/builtin-fetch--tool.c index 6a7851795..ed60847d9 100644 --- a/builtin-fetch--tool.c +++ b/builtin-fetch--tool.c @@ -435,9 +435,7 @@ static int pick_rref(int sha1_only, const char *rref, const char *ls_remote_resu cp++; if (!*cp) break; - np = strchr(cp, '\n'); - if (!np) - np = cp + strlen(cp); + np = strchrnul(cp, '\n'); if (pass) { lrr_list[i].line = cp; lrr_list[i].name = cp + 41; @@ -461,9 +459,7 @@ static int pick_rref(int sha1_only, const char *rref, const char *ls_remote_resu rref++; if (!*rref) break; - next = strchr(rref, '\n'); - if (!next) - next = rref + strlen(rref); + next = strchrnul(rref, '\n'); rreflen = next - rref; for (i = 0; i < lrr_count; i++) {