Merge branch 'tf/imap-send-create'
[gitweb.git] / imap-send.c
index 48733ccc45139400cdd3276dd2e16d547f8ea7fa..87f9bb18f6983a99499f170cef1f319f6c63d6f1 100644 (file)
@@ -915,7 +915,7 @@ static struct imap_store *imap_open_store(struct imap_server_conf *srvc, char *f
        char *arg, *rsp;
        int s = -1, preauth;
 
-       ctx = xcalloc(sizeof(*ctx), 1);
+       ctx = xcalloc(1, sizeof(*ctx));
 
        ctx->imap = imap = xcalloc(sizeof(*imap), 1);
        imap->buf.sock.fd[0] = imap->buf.sock.fd[1] = -1;
@@ -1310,13 +1310,9 @@ static char *imap_folder;
 
 static int git_imap_config(const char *key, const char *val, void *cb)
 {
-       char imap_key[] = "imap.";
-
-       if (strncmp(key, imap_key, sizeof imap_key - 1))
+       if (!skip_prefix(key, "imap.", &key))
                return 0;
 
-       key += sizeof imap_key - 1;
-
        /* check booleans first, and barf on others */
        if (!strcmp("sslverify", key))
                server.ssl_verify = git_config_bool(key, val);