]> granicus.if.org Git - php/commitdiff
a better way, i've been told (thanks)
authorColin Viebrock <cmv@php.net>
Thu, 6 Apr 2000 17:01:41 +0000 (17:01 +0000)
committerColin Viebrock <cmv@php.net>
Thu, 6 Apr 2000 17:01:41 +0000 (17:01 +0000)
ext/interbase/interbase.c

index 0afca99a96d566473bc9f8a7b597739f60c477f1..3d06f41ed175858be2347b74ba6d1255c466ffb2 100644 (file)
@@ -513,7 +513,6 @@ PHP_MINFO_FUNCTION(ibase)
 {
 
        char tmp[128];
-       char tmp2[128];
 
        IBLS_FETCH();
 
@@ -525,21 +524,17 @@ PHP_MINFO_FUNCTION(ibase)
 #endif
        php_info_print_table_row(2, "Allow Persistent Links", (IBG(allow_persistent)?"Yes":"No") );
 
-       sprintf(tmp, "%d/", IBG(num_persistent) );
        if (IBG(max_persistent) == -1) {
-               strcat(tmp, "unlimited");
+               snprintf(tmp, 128, "%d/unlimited", IBG(num_persistent));
        } else {
-               sprintf(tmp2, "%ld", IBG(max_persistent));
-               strcat(tmp, tmp2);
+               snprintf(tmp, 128, "%d/%ld", IBG(num_persistent), IBG(max_persistent));
        }
        php_info_print_table_row(2, "Persistent Links", tmp );
 
-       sprintf(tmp, "%d/", IBG(num_links) );
        if (IBG(max_links) == -1) {
-               strcat(tmp, "unlimited");
+               snprintf(tmp, 128, "%d/unlimited", IBG(num_links));
        } else {
-               sprintf(tmp2, "%ld", IBG(max_links));
-               strcat(tmp, tmp2);
+               snprintf(tmp, 128, "%d/%ld", IBG(num_links), IBG(max_links));
        }
        php_info_print_table_row(2, "Total Links", tmp );