summaryrefslogtreecommitdiff
path: root/xzlib.c
diff options
context:
space:
mode:
Diffstat (limited to 'xzlib.c')
-rw-r--r--xzlib.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/xzlib.c b/xzlib.c
index 5470c4e8..b5d35da8 100644
--- a/xzlib.c
+++ b/xzlib.c
@@ -216,11 +216,12 @@ xzFile
__libxml2_xzdopen(int fd, const char *mode)
{
char *path; /* identifier for error messages */
+ size_t path_size = 7 + 3 * sizeof(int);
xzFile xz;
- if (fd == -1 || (path = xmlMalloc(7 + 3 * sizeof(int))) == NULL)
+ if (fd == -1 || (path = xmlMalloc(path_size)) == NULL)
return NULL;
- sprintf(path, "<fd:%d>", fd); /* for debugging */
+ snprintf(path, path_size, "<fd:%d>", fd); /* for debugging */
xz = xz_open(path, fd, mode);
xmlFree(path);
return xz;