X-Git-Url: https://git.tokkee.org/?a=blobdiff_plain;f=imap-send.c;h=4283a4acdaf28a8edc2f595e6137cc396f4988dc;hb=1d431b22357389d0833830daf814ff0c4dc9189d;hp=3eaf025720c5432065b851ce98f861eee27eadee;hpb=460ca302fdf453459850676c049ed7b46b43a0d4;p=git.git diff --git a/imap-send.c b/imap-send.c index 3eaf02572..4283a4acd 100644 --- a/imap-send.c +++ b/imap-send.c @@ -224,7 +224,7 @@ socket_perror( const char *func, Socket_t *sock, int ret ) static int socket_read( Socket_t *sock, char *buf, int len ) { - int n = xread( sock->fd, buf, len ); + ssize_t n = xread( sock->fd, buf, len ); if (n <= 0) { socket_perror( "read", sock, n ); close( sock->fd ); @@ -1192,7 +1192,7 @@ count_messages( msg_data_t *msg ) char *p = msg->data; while (1) { - if (!strncmp( "From ", p, 5 )) { + if (!prefixcmp(p, "From ")) { count++; p += 5; } @@ -1216,7 +1216,7 @@ split_msg( msg_data_t *all_msgs, msg_data_t *msg, int *ofs ) data = &all_msgs->data[ *ofs ]; msg->len = all_msgs->len - *ofs; - if (msg->len < 5 || strncmp( data, "From ", 5 )) + if (msg->len < 5 || prefixcmp(data, "From ")) return 0; p = strchr( data, '\n' ); @@ -1267,12 +1267,12 @@ git_imap_config(const char *key, const char *val) imap_folder = xstrdup( val ); } else if (!strcmp( "host", key )) { { - if (!strncmp( "imap:", val, 5 )) + if (!prefixcmp(val, "imap:")) val += 5; if (!server.port) server.port = 143; } - if (!strncmp( "//", val, 2 )) + if (!prefixcmp(val, "//")) val += 2; server.host = xstrdup( val ); }