The following commit has been merged in the master branch:
commit 4433cd3ff11b6bd0ab0a17a36d233102b47cffe7
Author: Guillem Jover <[EMAIL PROTECTED]>
Date: Sun Jun 1 22:39:09 2008 +0300
libdpkg: Use memset instead of ad-hoc operation
diff --git a/ChangeLog b/ChangeLog
index 98d7fd3..47e83f2 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,9 @@
2008-06-01 Guillem Jover <[EMAIL PROTECTED]>
+ * lib/varbuf.c (varbufdupc): Use memset instead of ad-hoc operation.
+
+2008-06-01 Guillem Jover <[EMAIL PROTECTED]>
+
* lib/subproc.c (setup_subproc_signals): Use size_t intead of int
for the index, to fix a warning.
(cu_subproc_signals): Likewise.
diff --git a/lib/varbuf.c b/lib/varbuf.c
index 15dd15d..3336f03 100644
--- a/lib/varbuf.c
+++ b/lib/varbuf.c
@@ -38,11 +38,8 @@ void varbufdupc(struct varbuf *v, int c, ssize_t n) {
char *b = v->buf + v->used;
v->used += n;
if (v->used >= v->size) varbufextend(v);
-
- while(n) {
- *b= c;
- b++; n--;
- }
+
+ memset(b, c, n);
}
int varbufprintf(struct varbuf *v, const char *fmt, ...) {
--
dpkg's main repository
--
To UNSUBSCRIBE, email to [EMAIL PROTECTED]
with a subject of "unsubscribe". Trouble? Contact [EMAIL PROTECTED]