common/iobuf.c: Have iobuf_writestr use iobuf_write, not iobuf_writebyte
authorNeal H. Walfield <neal@g10code.com>
Mon, 17 Aug 2015 10:33:29 +0000 (12:33 +0200)
committerNeal H. Walfield <neal@g10code.com>
Thu, 20 Aug 2015 12:16:26 +0000 (14:16 +0200)
* common/iobuf.c (iobuf_write): Don't write a byte at a time.  Use
iobuf_write.

--
Signed-off-by: Neal H. Walfield <neal@g10code.com>.
common/iobuf.c

index e859a5c..4674fdf 100644 (file)
@@ -2108,12 +2108,7 @@ iobuf_write (iobuf_t a, const void *buffer, unsigned int buflen)
 int
 iobuf_writestr (iobuf_t a, const char *buf)
 {
-  int rc;
-
-  for (; *buf; buf++)
-    if ((rc=iobuf_writebyte (a, *buf)))
-      return rc;
-  return 0;
+  return iobuf_write (a, buf, strlen (buf));
 }