summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorRichard W.M. Jones <rjones@redhat.com>2012-03-12 11:24:51 +0000
committerRichard W.M. Jones <rjones@redhat.com>2012-03-12 11:53:03 +0000
commitb8cdf6c2b9d12df6acbe295fd75c8c59c8b7eec1 (patch)
tree21b33fc8c9f5b8e9b8f484a876d7341e5f512acd /src
parent24413ac4d8c8d64b3339f9e61886db8f7fbfed4f (diff)
downloadlibguestfs-b8cdf6c2b9d12df6acbe295fd75c8c59c8b7eec1.tar.gz
libguestfs-b8cdf6c2b9d12df6acbe295fd75c8c59c8b7eec1.tar.xz
libguestfs-b8cdf6c2b9d12df6acbe295fd75c8c59c8b7eec1.zip
lib: Use size_t for allocation size in safe realloc function.
Diffstat (limited to 'src')
-rw-r--r--src/guestfs-internal.h2
-rw-r--r--src/guestfs.c2
2 files changed, 2 insertions, 2 deletions
diff --git a/src/guestfs-internal.h b/src/guestfs-internal.h
index 82cb9a56..c679ada4 100644
--- a/src/guestfs-internal.h
+++ b/src/guestfs-internal.h
@@ -366,7 +366,7 @@ extern void guestfs_error_errno (guestfs_h *g, int errnum, const char *fs, ...)
__attribute__((format (printf,3,4)));
extern void guestfs_perrorf (guestfs_h *g, const char *fs, ...)
__attribute__((format (printf,2,3)));
-extern void *guestfs_safe_realloc (guestfs_h *g, void *ptr, int nbytes);
+extern void *guestfs_safe_realloc (guestfs_h *g, void *ptr, size_t nbytes);
extern char *guestfs_safe_strdup (guestfs_h *g, const char *str);
extern char *guestfs_safe_strndup (guestfs_h *g, const char *str, size_t n);
extern void *guestfs_safe_memdup (guestfs_h *g, void *ptr, size_t size);
diff --git a/src/guestfs.c b/src/guestfs.c
index 187e22ec..40925c8f 100644
--- a/src/guestfs.c
+++ b/src/guestfs.c
@@ -476,7 +476,7 @@ guestfs_safe_calloc (guestfs_h *g, size_t n, size_t s)
}
void *
-guestfs_safe_realloc (guestfs_h *g, void *ptr, int nbytes)
+guestfs_safe_realloc (guestfs_h *g, void *ptr, size_t nbytes)
{
void *p = realloc (ptr, nbytes);
if (nbytes > 0 && !p) g->abort_cb ();