mirror of
https://github.com/postgres/postgres.git
synced 2025-12-15 02:22:24 +03:00
Merge palloc()/MemSet(0) calls into a single palloc0() call.
This commit is contained in:
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* $Header: /cvsroot/pgsql/src/test/regress/regress.c,v 1.51 2002/08/22 00:01:51 tgl Exp $
|
||||
* $Header: /cvsroot/pgsql/src/test/regress/regress.c,v 1.52 2002/11/10 07:25:14 momjian Exp $
|
||||
*/
|
||||
|
||||
#include "postgres.h"
|
||||
@@ -300,12 +300,11 @@ reverse_name(char *string)
|
||||
int len;
|
||||
char *new_string;
|
||||
|
||||
if (!(new_string = palloc(NAMEDATALEN)))
|
||||
if (!(new_string = palloc0(NAMEDATALEN)))
|
||||
{
|
||||
fprintf(stderr, "reverse_name: palloc failed\n");
|
||||
return NULL;
|
||||
}
|
||||
MemSet(new_string, 0, NAMEDATALEN);
|
||||
for (i = 0; i < NAMEDATALEN && string[i]; ++i)
|
||||
;
|
||||
if (i == NAMEDATALEN || !string[i])
|
||||
|
||||
Reference in New Issue
Block a user