The following commit has been merged in the master branch:
commit 3ae09f975d9138de3c51359ef9ba0d7776a4cc86
Author: Guillem Jover <[email protected]>
Date: Sat Feb 19 09:28:55 2011 +0100
libdpkg: Add new varbuf_end_str()
diff --git a/lib/dpkg/libdpkg.Versions b/lib/dpkg/libdpkg.Versions
index 3446d14..fca0a7c 100644
--- a/lib/dpkg/libdpkg.Versions
+++ b/lib/dpkg/libdpkg.Versions
@@ -65,6 +65,7 @@ LIBDPKG_PRIVATE {
varbuf_dup_char;
varbuf_map_char;
varbuf_add_buf;
+ varbuf_end_str;
varbuf_printf;
varbuf_vprintf;
varbuf_detach;
diff --git a/lib/dpkg/varbuf.c b/lib/dpkg/varbuf.c
index be2a284..575e5aa 100644
--- a/lib/dpkg/varbuf.c
+++ b/lib/dpkg/varbuf.c
@@ -3,7 +3,7 @@
* varbuf.c - variable length expandable buffer handling
*
* Copyright © 1994,1995 Ian Jackson <[email protected]>
- * Copyright © 2008, 2009 Guillem Jover <[email protected]>
+ * Copyright © 2008-2011 Guillem Jover <[email protected]>
*
* This is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
@@ -101,6 +101,13 @@ varbuf_add_buf(struct varbuf *v, const void *s, size_t
size)
}
void
+varbuf_end_str(struct varbuf *v)
+{
+ varbuf_grow(v, 1);
+ v->buf[v->used] = '\0';
+}
+
+void
varbuf_init(struct varbuf *v, size_t size)
{
v->used = 0;
diff --git a/lib/dpkg/varbuf.h b/lib/dpkg/varbuf.h
index b841d56..a1aa82c 100644
--- a/lib/dpkg/varbuf.h
+++ b/lib/dpkg/varbuf.h
@@ -3,7 +3,7 @@
* varbuf.h - variable length expandable buffer handling
*
* Copyright © 1994, 1995 Ian Jackson <[email protected]>
- * Copyright © 2008, 2009 Guillem Jover <[email protected]>
+ * Copyright © 2008-2011 Guillem Jover <[email protected]>
*
* This is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
@@ -76,6 +76,7 @@ void varbuf_dup_char(struct varbuf *v, int c, size_t n);
void varbuf_map_char(struct varbuf *v, int c_src, int c_dst);
#define varbuf_add_str(v, s) varbuf_add_buf(v, s, strlen(s))
void varbuf_add_buf(struct varbuf *v, const void *s, size_t size);
+void varbuf_end_str(struct varbuf *v);
int varbuf_printf(struct varbuf *v, const char *fmt, ...) DPKG_ATTR_PRINTF(2);
int varbuf_vprintf(struct varbuf *v, const char *fmt, va_list va)
--
dpkg's main repository
--
To UNSUBSCRIBE, email to [email protected]
with a subject of "unsubscribe". Trouble? Contact [email protected]