]> granicus.if.org Git - php/commitdiff
Slightly safer code.
authorIlia Alshanetsky <iliaa@php.net>
Fri, 25 Mar 2005 00:30:43 +0000 (00:30 +0000)
committerIlia Alshanetsky <iliaa@php.net>
Fri, 25 Mar 2005 00:30:43 +0000 (00:30 +0000)
ext/pgsql/pgsql.c

index eaaa95ca81c479df1bc72986e00f93306404d6d2..f90f8fa66c6650f6086226fb6c1fcf3e00b67f91 100644 (file)
@@ -5164,7 +5164,7 @@ PHP_PGSQL_API int php_pgsql_insert(PGconn *pg_link, const char *table, zval *var
                                smart_str_append_long(&querystr, Z_LVAL_PP(val));
                                break;
                        case IS_DOUBLE:
-                               smart_str_appendl(&querystr, buf, sprintf(buf, "%f", Z_DVAL_PP(val)));
+                               smart_str_appendl(&querystr, buf, snprintf(buf, sizeof(buf), "%f", Z_DVAL_PP(val)));
                                break;
                        default:
                                /* should not happen */