Changeset: bc9fb151e560 for MonetDB
URL: https://dev.monetdb.org/hg/MonetDB/rev/bc9fb151e560
Modified Files:
        monetdb5/modules/atoms/inet.c
Branch: Dec2025
Log Message:

Do not use sprintf.


diffs (16 lines):

diff --git a/monetdb5/modules/atoms/inet.c b/monetdb5/modules/atoms/inet.c
--- a/monetdb5/modules/atoms/inet.c
+++ b/monetdb5/modules/atoms/inet.c
@@ -561,10 +561,10 @@ INEThost(Client ctx, str *retval, const 
        if (is_inet_nil(val)) {
                *retval = (char *) str_nil;
        } else {
-               ip = ma_alloc(ma, sizeof(char) * 16);
+               ip = ma_alloc(ma, 16);
                if (ip == NULL)
                        throw(MAL, "INEThost", SQLSTATE(HY013) MAL_MALLOC_FAIL);
-               sprintf(ip, "%d.%d.%d.%d", val->q1, val->q2, val->q3, val->q4);
+               snprintf(ip, 16, "%d.%d.%d.%d", val->q1, val->q2, val->q3, 
val->q4);
                *retval = ip;
        }
        return (MAL_SUCCEED);
_______________________________________________
checkin-list mailing list -- [email protected]
To unsubscribe send an email to [email protected]

Reply via email to