Skip to content

Commit 25f5ea0

Browse files
author
Ilia Alshanetsky
committed
MFH: No need to NULL terminate manually, snprintf() does it for us already.
1 parent 1618452 commit 25f5ea0

File tree

1 file changed

+0
-7
lines changed

1 file changed

+0
-7
lines changed

ext/ldap/ldap.c

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -293,12 +293,10 @@ PHP_MINFO_FUNCTION(ldap)
293293
} else {
294294
snprintf(tmp, 31, "%ld/%ld", LDAPG(num_links), LDAPG(max_links));
295295
}
296-
tmp[31] = '\0';
297296
php_info_print_table_row(2, "Total Links", tmp);
298297

299298
#ifdef LDAP_API_VERSION
300299
snprintf(tmp, 31, "%d", LDAP_API_VERSION);
301-
tmp[31] = '\0';
302300
php_info_print_table_row(2, "API Version", tmp);
303301
#endif
304302

@@ -308,27 +306,22 @@ PHP_MINFO_FUNCTION(ldap)
308306

309307
#ifdef LDAP_VENDOR_VERSION
310308
snprintf(tmp, 31, "%d", LDAP_VENDOR_VERSION);
311-
tmp[31] = '\0';
312309
php_info_print_table_row(2, "Vendor Version", tmp);
313310
#endif
314311

315312
#if HAVE_NSLDAP
316313
SDKVersion = ldap_version( &ver );
317314
snprintf(tmp, 31, "%f", SDKVersion/100.0 );
318-
tmp[31] = '\0';
319315
php_info_print_table_row(2, "SDK Version", tmp );
320316

321317
snprintf(tmp, 31, "%f", ver.protocol_version/100.0 );
322-
tmp[31] = '\0';
323318
php_info_print_table_row(2, "Highest LDAP Protocol Supported", tmp );
324319

325320
snprintf(tmp, 31, "%f", ver.SSL_version/100.0 );
326-
tmp[31] = '\0';
327321
php_info_print_table_row(2, "SSL Level Supported", tmp );
328322

329323
if ( ver.security_level != LDAP_SECURITY_NONE ) {
330324
snprintf(tmp, 31, "%d", ver.security_level );
331-
tmp[31] = '\0';
332325
} else {
333326
strcpy(tmp, "SSL not enabled" );
334327
}

0 commit comments

Comments
 (0)