diff options
author | Eric S. Raymond <esr@thyrsus.com> | 2001-06-24 22:32:14 +0000 |
---|---|---|
committer | Eric S. Raymond <esr@thyrsus.com> | 2001-06-24 22:32:14 +0000 |
commit | 3267c1f3d517be0410c1315031344749e5f051c7 (patch) | |
tree | 0c39214e43c6a19043cf8ba74fa2a12541c47c07 /transact.c | |
parent | 5d22bd95ff9fb9fa813268dadc02cb25428cbeb0 (diff) | |
download | fetchmail-3267c1f3d517be0410c1315031344749e5f051c7.tar.gz fetchmail-3267c1f3d517be0410c1315031344749e5f051c7.tar.bz2 fetchmail-3267c1f3d517be0410c1315031344749e5f051c7.zip |
HMH's second cleanup patch.
svn path=/trunk/; revision=3377
Diffstat (limited to 'transact.c')
-rw-r--r-- | transact.c | 27 |
1 files changed, 22 insertions, 5 deletions
@@ -1056,7 +1056,11 @@ int readheaders(int sock, ctl->server.pollname, ctl->remotename); } - strncat(buf, ")\r\n", sizeof(buf)); +#ifdef HAVE_SNPRINTF + snprintf(buf+strlen(buf), sizeof(buf)-strlen(buf), ")\r\n"); +#else + strcat(buf, ")\r\n"); +#endif /* HAVE_SNPRINTF */ n = stuffline(ctl, buf); if (n != -1) { @@ -1101,8 +1105,13 @@ int readheaders(int sock, else buf[1] = '\0'; - strncat(buf, rfc822timestamp(), sizeof(buf)); - strncat(buf, "\r\n", sizeof(buf)); +#ifdef HAVE_SNPRINTF + snprintf(buf+strlen(buf), sizeof(buf)-strlen(buf), "%s\r\n", + rfc822timestamp()); +#else + strcat(buf, rfc822timestamp()); + strcat(buf, "\r\n"); +#endif /* HAVE_SNPRINTF */ n = stuffline(ctl, buf); } } @@ -1337,7 +1346,11 @@ va_dcl #endif va_end(ap); - strncat(buf, "\r\n", sizeof(buf)); +#ifdef HAVE_SNPRINTF + snprintf(buf+strlen(buf), sizeof(buf)-strlen(buf), "\r\n"); +#else + strcat(buf, "\r\n"); +#endif /* HAVE_SNPRINTF */ SockWrite(sock, buf, strlen(buf)); if (outlevel >= O_MONITOR) @@ -1423,7 +1436,11 @@ va_dcl #endif va_end(ap); - strncat(buf, "\r\n", sizeof(buf)); +#ifdef HAVE_SNPRINTF + snprintf(buf+strlen(buf), sizeof(buf)-strlen(buf), "\r\n"); +#else + strcat(buf, "\r\n"); +#endif /* HAVE_SNPRINTF */ SockWrite(sock, buf, strlen(buf)); if (outlevel >= O_MONITOR) |