mirror of
https://github.com/postgres/postgres.git
synced 2025-09-02 04:21:28 +03:00
Standardize treatment of strcmp() return value
Always compare the return value to 0, don't use cute tricks like if (!strcmp(...)).
This commit is contained in:
@@ -14384,7 +14384,7 @@ myFormatType(const char *typname, int32 typmod)
|
||||
}
|
||||
|
||||
/* Show lengths on bpchar and varchar */
|
||||
if (!strcmp(typname, "bpchar"))
|
||||
if (strcmp(typname, "bpchar") == 0)
|
||||
{
|
||||
int len = (typmod - VARHDRSZ);
|
||||
|
||||
@@ -14393,14 +14393,14 @@ myFormatType(const char *typname, int32 typmod)
|
||||
appendPQExpBuffer(buf, "(%d)",
|
||||
typmod - VARHDRSZ);
|
||||
}
|
||||
else if (!strcmp(typname, "varchar"))
|
||||
else if (strcmp(typname, "varchar") == 0)
|
||||
{
|
||||
appendPQExpBuffer(buf, "character varying");
|
||||
if (typmod != -1)
|
||||
appendPQExpBuffer(buf, "(%d)",
|
||||
typmod - VARHDRSZ);
|
||||
}
|
||||
else if (!strcmp(typname, "numeric"))
|
||||
else if (strcmp(typname, "numeric") == 0)
|
||||
{
|
||||
appendPQExpBuffer(buf, "numeric");
|
||||
if (typmod != -1)
|
||||
|
Reference in New Issue
Block a user