]> granicus.if.org Git - php/commitdiff
Use strncpy instead of sprintf
authorStanislav Malyshev <stas@php.net>
Mon, 31 Mar 2003 07:34:05 +0000 (07:34 +0000)
committerStanislav Malyshev <stas@php.net>
Mon, 31 Mar 2003 07:34:05 +0000 (07:34 +0000)
Zend/zend.c

index 84d72cd8d49f8a5bc1e03c810c7376271df7ada2..c9f50227c1efdf7fddf23d8cfd1bdee09937419d 100644 (file)
@@ -992,7 +992,8 @@ ZEND_API int zend_execute_scripts(int type TSRMLS_DC, zval **retval, int file_co
                        if (EG(exception)) {
                                char ex_class_name[128];
                                if(Z_TYPE_P(EG(exception)) == IS_OBJECT) {
-                                       snprintf(ex_class_name, 127, "%s", Z_OBJ_CLASS_NAME_P(EG(exception)));
+                                       strncpy(ex_class_name, Z_OBJ_CLASS_NAME_P(EG(exception)), 127);
+                                       ex_class_name[127] = '\0';
                                } else {
                                        strcpy(ex_class_name, "Unknown Exception");
                                }