]> granicus.if.org Git - sudo/commitdiff
Make easprintf() and evasprintf() return an int.
authorTodd C. Miller <Todd.Miller@courtesan.com>
Wed, 10 May 2000 05:10:33 +0000 (05:10 +0000)
committerTodd C. Miller <Todd.Miller@courtesan.com>
Wed, 10 May 2000 05:10:33 +0000 (05:10 +0000)
alloc.c

diff --git a/alloc.c b/alloc.c
index b54ab30ff1aeed2a89ab65ccefb1d394a684c872..930deb9744ddf75cbdd5b038ee998fbebaee173b 100644 (file)
--- a/alloc.c
+++ b/alloc.c
@@ -121,7 +121,7 @@ estrdup(src)
  * easprintf() calls vasprintf() and exits with an error if vasprintf()
  * returns -1 (out of memory).
  */
-void
+int
 #ifdef __STDC__
 easprintf(char **ret, const char *fmt, ...)
 #else
@@ -148,21 +148,24 @@ easprintf(va_alist)
        (void) fprintf(stderr, "%s: cannot allocate memory!\n", Argv[0]);
        exit(1);
     }
+    return(len);
 }
 
 /*
  * evasprintf() calls vasprintf() and exits with an error if vasprintf()
  * returns -1 (out of memory).
  */
-void
+int
 evasprintf(ret, format, args)
     char **ret;
     const char *format;
     va_list args;
 {
+    int len;
 
-    if (vasprintf(ret, format, args) == -1) {
+    if ((len = vasprintf(ret, format, args)) == -1) {
        (void) fprintf(stderr, "%s: cannot allocate memory!\n", Argv[0]);
        exit(1);
     }
+    return(len);
 }