]> git.ipfire.org Git - thirdparty/git.git/blobdiff - credential-cache--daemon.c
refactor skip_prefix to return a boolean
[thirdparty/git.git] / credential-cache--daemon.c
index 390f194252cc6d7c0c9f43e2a48692324bf0b665..3b370ca5e529c74e17e0f39da5c689ebc4ccfc25 100644 (file)
@@ -109,14 +109,12 @@ static int read_request(FILE *fh, struct credential *c,
        const char *p;
 
        strbuf_getline(&item, fh, '\n');
-       p = skip_prefix(item.buf, "action=");
-       if (!p)
+       if (!skip_prefix(item.buf, "action=", &p))
                return error("client sent bogus action line: %s", item.buf);
        strbuf_addstr(action, p);
 
        strbuf_getline(&item, fh, '\n');
-       p = skip_prefix(item.buf, "timeout=");
-       if (!p)
+       if (!skip_prefix(item.buf, "timeout=", &p))
                return error("client sent bogus timeout line: %s", item.buf);
        *timeout = atoi(p);