]> git.ipfire.org Git - thirdparty/shadow.git/commitdiff
*/: s/SNPRINTF/stprintf_a/
authorAlejandro Colomar <alx@kernel.org>
Tue, 14 Oct 2025 10:49:08 +0000 (12:49 +0200)
committerSerge Hallyn <serge@hallyn.com>
Fri, 28 Nov 2025 02:50:48 +0000 (20:50 -0600)
This name better reflects that it handles arrays, and doesn't shout.

Signed-off-by: Alejandro Colomar <alx@kernel.org>
21 files changed:
lib/audit_help.c
lib/commonio.c
lib/env.c
lib/get_pid.c
lib/hushed.c
lib/nss.c
lib/pwauth.c
lib/shell.c
lib/string/README
lib/string/sprintf/snprintf.h
lib/subordinateio.c
lib/user_busy.c
src/chage.c
src/gpasswd.c
src/login.c
src/newgrp.c
src/newusers.c
src/su.c
src/useradd.c
src/vipw.c
tests/unit/test_snprintf.c

index 68835091e0c33aadc4bd7129bc42dbd1f4f7db4f..b0ac5631e5eeca5edf2f6cd24390302948ef88f1 100644 (file)
@@ -104,10 +104,10 @@ audit_logger_with_group(int type, const char *op, const char *name,
 
        len = strnlen(grp, sizeof(enc_group)/2);
        if (audit_value_needs_encoding(grp, len)) {
-               SNPRINTF(buf, "%s %s=%s", op, grp_type,
+               stprintf_a(buf, "%s %s=%s", op, grp_type,
                        audit_encode_value(enc_group, grp, len));
        } else {
-               SNPRINTF(buf, "%s %s=\"%s\"", op, grp_type, grp);
+               stprintf_a(buf, "%s %s=\"%s\"", op, grp_type, grp);
        }
 
        audit_log_acct_message(audit_fd, type, NULL, buf, name, id,
index 73afa6098d8bd5872cd09ebd9428d31c4abad421..d37ba23c9f8077dfe8aa8557046d9d5d21a88175 100644 (file)
@@ -140,7 +140,7 @@ static int do_lock_file (const char *file, const char *lock, bool log)
        }
 
        pid = getpid ();
-       SNPRINTF(buf, "%lu", (unsigned long) pid);
+       stprintf_a(buf, "%lu", (unsigned long) pid);
        len = (ssize_t) strlen (buf) + 1;
        if (write_full(fd, buf, len) == -1) {
                if (log) {
@@ -340,7 +340,7 @@ static void free_linked_list (struct commonio_db *db)
 
 int commonio_setname (struct commonio_db *db, const char *name)
 {
-       SNPRINTF(db->filename, "%s", name);
+       stprintf_a(db->filename, "%s", name);
        db->setname = true;
        return 1;
 }
@@ -486,7 +486,7 @@ int commonio_unlock (struct commonio_db *db, bool process_selinux)
                 * then call ulckpwdf() (if used) on last unlock.
                 */
                db->locked = false;
-               SNPRINTF(lock, "%s.lock", db->filename);
+               stprintf_a(lock, "%s.lock", db->filename);
                unlink (lock);
                dec_lock_count ();
                return 1;
@@ -916,7 +916,7 @@ int commonio_close (struct commonio_db *db, bool process_selinux)
                /*
                 * Create backup file.
                 */
-               if (SNPRINTF(buf, "%s-", db->filename) == -1) {
+               if (stprintf_a(buf, "%s-", db->filename) == -1) {
                        (void) fclose (db->fp);
                        db->fp = NULL;
                        goto fail;
@@ -955,7 +955,7 @@ int commonio_close (struct commonio_db *db, bool process_selinux)
                sb.st_gid = db->st_gid;
        }
 
-       if (SNPRINTF(buf, "%s+", db->filename) == -1)
+       if (stprintf_a(buf, "%s+", db->filename) == -1)
                goto fail;
 
 #ifdef WITH_SELINUX
index 91424087d995ce587d441cc8308cdf1404d7522f..37951b3b2c9ab30b61f0510b206d4ffb838fd55e 100644 (file)
--- a/lib/env.c
+++ b/lib/env.c
@@ -170,7 +170,7 @@ void set_env (int argc, char *const *argv)
 
                cp = strchr (*argv, '=');
                if (NULL == cp) {
-                       assert(SNPRINTF(variable, "L%d", noname) != -1);
+                       assert(stprintf_a(variable, "L%d", noname) != -1);
                        noname++;
                        addenv (variable, *argv);
                } else {
index 7f80b16459fe4020191ae7df13492ecf9d82b1a7..6ccc79d79bb03427a03ca746d7edb611660ca9b3 100644 (file)
@@ -59,7 +59,7 @@ int open_pidfd(const char *pidstr)
        if (get_pid(pidstr, &target) == -1)
                return -ENOENT;
 
-       if (SNPRINTF(proc_dir_name, "/proc/%d/", target) == -1) {
+       if (stprintf_a(proc_dir_name, "/proc/%d/", target) == -1) {
                fprintf(stderr, "snprintf of proc path failed for %d: %s\n",
                        target, strerrno());
                return -EINVAL;
index 56add9e96407ba74136f3db2069a398ed3cd06ac..530996f40ca1bddecc838d6594e0ec376d9846e6 100644 (file)
@@ -60,7 +60,7 @@ bool hushed (const char *username)
         */
 
        if (hushfile[0] != '/') {
-               SNPRINTF(buf, "%s/%s", pw->pw_dir, hushfile);
+               stprintf_a(buf, "%s/%s", pw->pw_dir, hushfile);
                return (access (buf, F_OK) == 0);
        }
 
index 9f30b0a11076689096cd44c6077e1a1e27dac897..21a149db06a1f2907f0786ab5bc404e285aa01fb 100644 (file)
--- a/lib/nss.c
+++ b/lib/nss.c
@@ -109,7 +109,7 @@ nss_init(const char *nsswitch_path) {
                fprintf(shadow_logfd, "Using files\n");
                goto null_subid;
        }
-       SNPRINTF(libname, "libsubid_%s.so", p);
+       stprintf_a(libname, "libsubid_%s.so", p);
        h = dlopen(libname, RTLD_LAZY);
        if (!h) {
                fprintf(shadow_logfd, "Error opening %s: %s\n", libname, dlerror());
index 3a2ccb29653df53c421a7fb53a27223333d7e731..0f0d2ff77cf0f3e3077dc024ce607a39d28ddbe8 100644 (file)
@@ -111,7 +111,7 @@ pw_auth(const char *cipher, const char *user)
        }
 #endif
 
-       SNPRINTF(prompt, cp, user);
+       stprintf_a(prompt, cp, user);
        clear = agetpass(prompt);
        input = (clear == NULL) ? "" : clear;
 
index 40b840ee951f3f26acdd166788ccd34395cd89d9..1e49df7b03465c2ea04b373798ea031728725759 100644 (file)
@@ -48,7 +48,7 @@ int shell (const char *file, /*@null@*/const char *arg, char *const envp[])
         * don't want to tell us what it is themselves.
         */
        if (arg == NULL) {
-               SNPRINTF(arg0, "-%s", Basename(file));
+               stprintf_a(arg0, "-%s", Basename(file));
                arg = arg0;
        }
 
@@ -74,7 +74,7 @@ int shell (const char *file, /*@null@*/const char *arg, char *const envp[])
         * how to execute this stupid shell, so I might as well give
         * up in disgust ...
         */
-       SNPRINTF(arg0, _("Cannot execute %s"), file);
+       stprintf_a(arg0, _("Cannot execute %s"), file);
        errno = err;
        perror (arg0);
        return err;
index dfe6465c5b693c73fdac17f495fee41aa60e1655..37eb4f1d72105fcf15827624cd68cf8f29a9bc4d 100644 (file)
@@ -213,7 +213,7 @@ sprintf/ - Formatted string creation
        snprintf(3) wrapper that reports truncation with -1.
        If you need more than one call to form a string,
        use seprintf() instead.
-    STPRINTF()  // Current name: SNPRINTF()
+    stprintf_a()
        Like stprintf(), but takes an array.
 
     seprintf()  // Current name: stpeprintf())
index 94f7ee3ca5f5809def835ee2c90be04accaab64b..f6dee1245fc21b6fb4455d7fde750d93f647fe97 100644 (file)
@@ -16,7 +16,8 @@
 #include "sizeof.h"
 
 
-#define SNPRINTF(s, fmt, ...)                                                 \
+// stprintf_a - string truncate print formatted array
+#define stprintf_a(s, fmt, ...)                                               \
 (                                                                             \
        snprintf_(s, countof(s), fmt __VA_OPT__(,) __VA_ARGS__)               \
 )
index 0a6835e75666266d4d66caf6d69841b8244aec6c..37f6ab2f862bcb92669b655191299778eb0fdfa7 100644 (file)
@@ -226,7 +226,7 @@ static const struct subordinate_range *find_range(struct commonio_db *db,
                 return NULL;
         }
         owner_uid = pwd->pw_uid;
-        if (SNPRINTF(owner_uid_string, "%lu", (unsigned long) owner_uid) == -1)
+        if (stprintf_a(owner_uid_string, "%lu", (unsigned long) owner_uid) == -1)
                 return NULL;
 
         commonio_rewind(db);
index d9103c53911624a2ff0adf5a1bf7763c5ad5eeda..09bf8c8116864ab6d06f3865f829e74d4249ae96 100644 (file)
@@ -98,7 +98,7 @@ static int different_namespace (const char *sname)
        char     path[41];
        char     buf[512], buf2[512];
 
-       SNPRINTF(path, "/proc/%s/ns/user", sname);
+       stprintf_a(path, "/proc/%s/ns/user", sname);
 
        if (readlinknul_a(path, buf) == -1)
                return 0;
@@ -121,7 +121,7 @@ static int check_status (const char *name, const char *sname, uid_t uid)
        char  line[1024];
        FILE  *sfile;
 
-       SNPRINTF(status, "/proc/%s/status", sname);
+       stprintf_a(status, "/proc/%s/status", sname);
 
        sfile = fopen (status, "r");
        if (NULL == sfile) {
@@ -214,7 +214,7 @@ static int user_busy_processes (const char *name, uid_t uid)
                }
 
                /* Check if the process is in our chroot */
-               SNPRINTF(root_path, "/proc/%lu/root", (unsigned long) pid);
+               stprintf_a(root_path, "/proc/%lu/root", (unsigned long) pid);
                if (stat (root_path, &sbroot_process) != 0) {
                        continue;
                }
@@ -234,7 +234,7 @@ static int user_busy_processes (const char *name, uid_t uid)
                        return 1;
                }
 
-               SNPRINTF(task_path, "/proc/%lu/task", (unsigned long) pid);
+               stprintf_a(task_path, "/proc/%lu/task", (unsigned long) pid);
                task_dir = opendir (task_path);
                if (task_dir != NULL) {
                        while (NULL != (ent = readdir(task_dir))) {
index 8555db8aec4c5bc3fb765399591ce1456ab0ee04..d1b04b4dda39de03664a0618354621104e067a50 100644 (file)
@@ -171,12 +171,12 @@ static int new_fields (void)
        (void) puts (_("Enter the new value, or press ENTER for the default"));
        (void) puts ("");
 
-       SNPRINTF(buf, "%ld", mindays);
+       stprintf_a(buf, "%ld", mindays);
        change_field (buf, sizeof buf, _("Minimum Password Age"));
        if (a2sl(&mindays, buf, NULL, 0, -1, LONG_MAX) == -1)
                return 0;
 
-       SNPRINTF(buf, "%ld", maxdays);
+       stprintf_a(buf, "%ld", maxdays);
        change_field (buf, sizeof buf, _("Maximum Password Age"));
        if (a2sl(&maxdays, buf, NULL, 0, -1, LONG_MAX) == -1)
                return 0;
@@ -197,12 +197,12 @@ static int new_fields (void)
                }
        }
 
-       SNPRINTF(buf, "%ld", warndays);
+       stprintf_a(buf, "%ld", warndays);
        change_field (buf, sizeof buf, _("Password Expiration Warning"));
        if (a2sl(&warndays, buf, NULL, 0, -1, LONG_MAX) == -1)
                return 0;
 
-       SNPRINTF(buf, "%ld", inactdays);
+       stprintf_a(buf, "%ld", inactdays);
        change_field (buf, sizeof buf, _("Password Inactive"));
        if (a2sl(&inactdays, buf, NULL, 0, -1, LONG_MAX) == -1)
                return 0;
index 6dec40d662816c8e7aa058228f21280d3f09b415..1224d80a8970354eb29c08c772bc7bcfea99dc9a 100644 (file)
@@ -476,7 +476,7 @@ static void log_gpasswd_failure_group (MAYBE_UNUSED void *arg)
 {
        char  buf[1024];
 
-       SNPRINTF(buf, " in %s", gr_dbname());
+       stprintf_a(buf, " in %s", gr_dbname());
        log_gpasswd_failure (buf);
 }
 
@@ -485,7 +485,7 @@ static void log_gpasswd_failure_gshadow (MAYBE_UNUSED void *arg)
 {
        char  buf[1024];
 
-       SNPRINTF(buf, " in %s", sgr_dbname());
+       stprintf_a(buf, " in %s", sgr_dbname());
        log_gpasswd_failure (buf);
 }
 #endif                         /* SHADOWGRP */
@@ -521,7 +521,7 @@ static void log_gpasswd_success (const char *suffix)
                         "password of group %s removed by %s%s",
                         group, myname, suffix));
 #ifdef WITH_AUDIT
-               SNPRINTF(buf, "password of group %s removed by %s%s",
+               stprintf_a(buf, "password of group %s removed by %s%s",
                         group, myname, suffix);
                audit_logger_with_group (AUDIT_GRP_CHAUTHTOK,
                              "delete-group-password",
@@ -533,7 +533,7 @@ static void log_gpasswd_success (const char *suffix)
                         "access to group %s restricted by %s%s",
                         group, myname, suffix));
 #ifdef WITH_AUDIT
-               SNPRINTF(buf, "access to group %s restricted by %s%s",
+               stprintf_a(buf, "access to group %s restricted by %s%s",
                         group, myname, suffix);
                audit_logger_with_group (AUDIT_GRP_MGMT,
                              "restrict-group",
@@ -587,7 +587,7 @@ static void log_gpasswd_success_group (MAYBE_UNUSED void *arg)
 {
        char  buf[1024];
 
-       SNPRINTF(buf, " in %s", gr_dbname());
+       stprintf_a(buf, " in %s", gr_dbname());
        log_gpasswd_success (buf);
 }
 
index 9f193b0044290f69f5f531a0a381ae896836d29f..dfc0f96c6f2fbf37097c3252b661f23fc938811a 100644 (file)
@@ -590,16 +590,16 @@ int main (int argc, char **argv)
        }
 
        if (!streq(cp, "")) {
-               SNPRINTF(fromhost, " on '%.100s' from '%.200s'", tty, cp);
+               stprintf_a(fromhost, " on '%.100s' from '%.200s'", tty, cp);
        } else {
-               SNPRINTF(fromhost, " on '%.100s'", tty);
+               stprintf_a(fromhost, " on '%.100s'", tty);
        }
        free(host);
 
       top:
        /* only allow ALARM sec. for login */
        timeout = getdef_unum ("LOGIN_TIMEOUT", ALARM);
-       SNPRINTF(tmsg, _("\nLogin timed out after %u seconds.\n"), timeout);
+       stprintf_a(tmsg, _("\nLogin timed out after %u seconds.\n"), timeout);
        (void) signal (SIGALRM, alarm_handler);
        if (timeout > 0) {
                (void) alarm (timeout);
@@ -644,7 +644,7 @@ int main (int argc, char **argv)
 
                /* Make the login prompt look like we want it */
                if (gethostname (hostn, sizeof (hostn)) == 0) {
-                       SNPRINTF(loginprompt, _("%s login: "), hostn);
+                       stprintf_a(loginprompt, _("%s login: "), hostn);
                } else {
                        STRTCPY(loginprompt, _("login: "));
                }
index 13b6ac17b44973a566f5701c7fbd3f55b12e83a6..325a9141b00dfb18408c797c53f0bb99a6c79d17 100644 (file)
@@ -199,7 +199,7 @@ static void check_perms (const struct group *grp,
                if (streq(grp->gr_passwd, "") ||
                    !streq(grp->gr_passwd, cpasswd)) {
 #ifdef WITH_AUDIT
-                       SNPRINTF(audit_buf, "authentication new_gid=%lu",
+                       stprintf_a(audit_buf, "authentication new_gid=%lu",
                                 (unsigned long) grp->gr_gid);
                        audit_logger (AUDIT_GRP_AUTH,
                                      audit_buf, NULL, getuid (), SHADOW_AUDIT_FAILURE);
@@ -212,7 +212,7 @@ static void check_perms (const struct group *grp,
                        goto failure;
                }
 #ifdef WITH_AUDIT
-               SNPRINTF(audit_buf, "authentication new_gid=%lu",
+               stprintf_a(audit_buf, "authentication new_gid=%lu",
                         (unsigned long) grp->gr_gid);
                audit_logger (AUDIT_GRP_AUTH,
                              audit_buf, NULL, getuid (), SHADOW_AUDIT_SUCCESS);
@@ -699,7 +699,7 @@ int main (int argc, char **argv)
        if (setgid (gid) != 0) {
                perror ("setgid");
 #ifdef WITH_AUDIT
-               SNPRINTF(audit_buf, "changing new_gid=%lu", (unsigned long) gid);
+               stprintf_a(audit_buf, "changing new_gid=%lu", (unsigned long) gid);
                audit_logger (AUDIT_CHGRP_ID,
                              audit_buf, NULL, getuid (), SHADOW_AUDIT_FAILURE);
 #endif
@@ -709,7 +709,7 @@ int main (int argc, char **argv)
        if (setuid (getuid ()) != 0) {
                perror ("setuid");
 #ifdef WITH_AUDIT
-               SNPRINTF(audit_buf, "changing new_gid=%lu", (unsigned long) gid);
+               stprintf_a(audit_buf, "changing new_gid=%lu", (unsigned long) gid);
                audit_logger (AUDIT_CHGRP_ID,
                              audit_buf, NULL, getuid (), SHADOW_AUDIT_FAILURE);
 #endif
@@ -724,7 +724,7 @@ int main (int argc, char **argv)
                closelog ();
                execl (SHELL, "sh", "-c", command, (char *) NULL);
 #ifdef WITH_AUDIT
-               SNPRINTF(audit_buf, "changing new_gid=%lu", (unsigned long) gid);
+               stprintf_a(audit_buf, "changing new_gid=%lu", (unsigned long) gid);
                audit_logger (AUDIT_CHGRP_ID,
                              audit_buf, NULL, getuid (), SHADOW_AUDIT_FAILURE);
 #endif
@@ -792,7 +792,7 @@ int main (int argc, char **argv)
        }
 
 #ifdef WITH_AUDIT
-       SNPRINTF(audit_buf, "changing new_gid=%lu", (unsigned long) gid);
+       stprintf_a(audit_buf, "changing new_gid=%lu", (unsigned long) gid);
        audit_logger (AUDIT_CHGRP_ID,
                      audit_buf, NULL, getuid (), SHADOW_AUDIT_SUCCESS);
 #endif
index 70e9eb7d77e8c52816310a3233065c712015ae05..818f73fa233f8faafe5f24cb0411c0de4223caa6 100644 (file)
@@ -736,7 +736,7 @@ static void process_flags (int argc, char **argv, struct option_flags *flags)
                if (freopen (argv[optind], "r", stdin) == NULL) {
                        char  buf[BUFSIZ];
 
-                       SNPRINTF(buf, "%s: %s", Prog, argv[1]);
+                       stprintf_a(buf, "%s: %s", Prog, argv[1]);
                        perror (buf);
                        fail_exit (EXIT_FAILURE, !flags->chroot);
                }
index 98ced92a01c9b875eca527099d98ff598baf7454..2cfb2cf56a43ac90ceaf5979eaa9d36e282795be 100644 (file)
--- a/src/su.c
+++ b/src/su.c
@@ -394,8 +394,8 @@ static void prepare_pam_close_session (void)
                              stderr);
                (void) kill (-pid_child, caught);
 
-               SNPRINTF(kill_msg, _(" ...killed.\n"));
-               SNPRINTF(wait_msg, _(" ...waiting for child to terminate.\n"));
+               stprintf_a(kill_msg, _(" ...killed.\n"));
+               stprintf_a(wait_msg, _(" ...waiting for child to terminate.\n"));
 
                /* Any signals other than SIGCHLD and SIGALRM will no longer have any effect,
                 * so it's time to block all of them. */
index d4883b5efb0ee5cea6b43f4e18fc81ef1c3776e4..efc366c9da587051917463ae8b2a11b47a9c4c2d 100644 (file)
@@ -690,7 +690,7 @@ set_defaults(void)
        /*
         * Rename the current default file to its backup name.
         */
-       assert(SNPRINTF(buf, "%s-", default_file) != -1);
+       assert(stprintf_a(buf, "%s-", default_file) != -1);
        unlink (buf);
        if ((link (default_file, buf) != 0) && (ENOENT != errno)) {
                fprintf (stderr,
index 83ff3d92bbe2b74832882adf326407c4fe93e44f..a3d2d7f48ce671d515b5fe9f13774a75f89a3b5e 100644 (file)
@@ -206,7 +206,7 @@ vipwedit (const char *file, int (*file_lock) (void), int (*file_unlock) (bool))
        /* FIXME: the following should have variable sizes */
        char         filebackup[1024], fileedit[1024];
 
-       SNPRINTF(filebackup, "%s-", file);
+       stprintf_a(filebackup, "%s-", file);
 #ifdef WITH_TCB
        if (tcb_mode) {
                if (   (mkdir (TCB_DIR "/" SHADOWTCB_SCRATCHDIR, 0700) != 0)
@@ -216,12 +216,12 @@ vipwedit (const char *file, int (*file_lock) (void), int (*file_unlock) (bool))
                if (shadowtcb_drop_priv () == SHADOWTCB_FAILURE) {
                        vipwexit (_("failed to drop privileges"), errno, 1);
                }
-               SNPRINTF(fileedit,
+               stprintf_a(fileedit,
                         TCB_DIR "/" SHADOWTCB_SCRATCHDIR "/.vipw.shadow.%s",
                         user);
        } else {
 #endif                         /* WITH_TCB */
-               SNPRINTF(fileedit, "%s.edit", file);
+               stprintf_a(fileedit, "%s.edit", file);
 #ifdef WITH_TCB
        }
 #endif                         /* WITH_TCB */
index fb22d6d166e451d4c5f6a7fcb5c8988f65c98389..f873de6274cbb4dc397a13ae8554964aaeea7218 100644 (file)
 #include "string/sprintf/snprintf.h"
 
 
-static void test_SNPRINTF_trunc(void **state);
-static void test_SNPRINTF_ok(void **state);
+static void test_stprintf_a_trunc(void **state);
+static void test_stprintf_a_ok(void **state);
 
 
 int
 main(void)
 {
     const struct CMUnitTest  tests[] = {
-        cmocka_unit_test(test_SNPRINTF_trunc),
-        cmocka_unit_test(test_SNPRINTF_ok),
+        cmocka_unit_test(test_stprintf_a_trunc),
+        cmocka_unit_test(test_stprintf_a_ok),
     };
 
     return cmocka_run_group_tests(tests, NULL, NULL);
@@ -34,33 +34,33 @@ main(void)
 
 
 static void
-test_SNPRINTF_trunc(void **state)
+test_stprintf_a_trunc(void **state)
 {
        char  buf[countof("foo")];
 
        // Test that we're not returning SIZE_MAX
-       assert_true(SNPRINTF(buf, "f%su", "oo") < 0);
+       assert_true(stprintf_a(buf, "f%su", "oo") < 0);
        assert_true(strcmp(buf, "foo") == 0);
 
-       assert_true(SNPRINTF(buf, "barbaz") == -1);
+       assert_true(stprintf_a(buf, "barbaz") == -1);
        assert_true(strcmp(buf, "bar") == 0);
 }
 
 
 static void
-test_SNPRINTF_ok(void **state)
+test_stprintf_a_ok(void **state)
 {
        char  buf[countof("foo")];
 
-       assert_true(SNPRINTF(buf, "%s", "foo") == strlen("foo"));
+       assert_true(stprintf_a(buf, "%s", "foo") == strlen("foo"));
        assert_true(strcmp(buf, "foo") == 0);
 
-       assert_true(SNPRINTF(buf, "%do", 1) == strlen("1o"));
+       assert_true(stprintf_a(buf, "%do", 1) == strlen("1o"));
        assert_true(strcmp(buf, "1o") == 0);
 
-       assert_true(SNPRINTF(buf, "f") == strlen("f"));
+       assert_true(stprintf_a(buf, "f") == strlen("f"));
        assert_true(strcmp(buf, "f") == 0);
 
-       assert_true(SNPRINTF(buf, "") == strlen(""));
+       assert_true(stprintf_a(buf, "") == strlen(""));
        assert_true(strcmp(buf, "") == 0);
 }