if (*test && (strncmp(pos, test, length) == 0))
return 1;
}
- while (strcmp(test, ""));
+ while (strcmp(test, "") != 0);
va_end(ap);
*--aux = '0'; /* fill the remaining EAN13 with '0' */
/* find out the data type: */
- if (!strncmp("978", buf, 3))
+ if (strncmp("978", buf, 3) == 0)
{ /* ISBN */
type = ISBN;
}
- else if (!strncmp("977", buf, 3))
+ else if (strncmp("977", buf, 3) == 0)
{ /* ISSN */
type = ISSN;
}
- else if (!strncmp("9790", buf, 4))
+ else if (strncmp("9790", buf, 4) == 0)
{ /* ISMN */
type = ISMN;
}
- else if (!strncmp("979", buf, 3))
+ else if (strncmp("979", buf, 3) == 0)
{ /* ISBN-13 */
type = ISBN;
}
}
/* find out what type of hyphenation is needed: */
- if (!strncmp("978-", result, search))
+ if (strncmp("978-", result, search) == 0)
{ /* ISBN -13 978-range */
/* The string should be in this form: 978-??000000000-0" */
type = ISBN;
TABLE = ISBN_range;
TABLE_index = ISBN_index;
}
- else if (!strncmp("977-", result, search))
+ else if (strncmp("977-", result, search) == 0)
{ /* ISSN */
/* The string should be in this form: 977-??000000000-0" */
type = ISSN;
TABLE = ISSN_range;
TABLE_index = ISSN_index;
}
- else if (!strncmp("979-0", result, search + 1))
+ else if (strncmp("979-0", result, search + 1) == 0)
{ /* ISMN */
/* The string should be in this form: 979-0?000000000-0" */
type = ISMN;
TABLE = ISMN_range;
TABLE_index = ISMN_index;
}
- else if (!strncmp("979-", result, search))
+ else if (strncmp("979-", result, search) == 0)
{ /* ISBN-13 979-range */
/* The string should be in this form: 979-??000000000-0" */
type = ISBN;
/* now get the subtype of EAN13: */
if (buf[3] == '0')
type = UPC;
- else if (!strncmp("977", buf + 3, 3))
+ else if (strncmp("977", buf + 3, 3) == 0)
type = ISSN;
- else if (!strncmp("978", buf + 3, 3))
+ else if (strncmp("978", buf + 3, 3) == 0)
type = ISBN;
- else if (!strncmp("9790", buf + 3, 4))
+ else if (strncmp("9790", buf + 3, 4) == 0)
type = ISMN;
- else if (!strncmp("979", buf + 3, 3))
+ else if (strncmp("979", buf + 3, 3) == 0)
type = ISBN;
if (accept != EAN13 && accept != ANY && type != accept)
goto eanwrongtype;
{
if (pg_strcasecmp(my_commands->argv[2], "us") != 0 &&
pg_strcasecmp(my_commands->argv[2], "ms") != 0 &&
- pg_strcasecmp(my_commands->argv[2], "s"))
+ pg_strcasecmp(my_commands->argv[2], "s") != 0)
{
fprintf(stderr, "%s: unknown time unit '%s' - must be us, ms or s\n",
my_commands->argv[0], my_commands->argv[2]);
sp = salt;
/* If it starts with the magic string, then skip that */
- if (!strncmp(sp, magic, strlen(magic)))
+ if (strncmp(sp, magic, strlen(magic)) == 0)
sp += strlen(magic);
/* It stops at the first '$', max 8 chars */
name = px_resolve_alias(int_aliases, name);
for (i = 0; int_ciphers[i].name; i++)
- if (!strcmp(int_ciphers[i].name, name))
+ if (strcmp(int_ciphers[i].name, name) == 0)
{
c = int_ciphers[i].load();
break;
name = px_resolve_alias(ossl_aliases, name);
for (i = ossl_cipher_types; i->name; i++)
- if (!strcmp(i->name, name))
+ if (strcmp(i->name, name) == 0)
break;
if (i->name == NULL)
return PXE_NO_CIPHER;
{
if (!c->id_len)
break;
- if (!strncmp(salt, c->id, c->id_len))
+ if (strncmp(salt, c->id, c->id_len) == 0)
break;
}
if (p2 != NULL)
{
*p2++ = 0;
- if (!strcmp(p, "pad"))
+ if (strcmp(p, "pad") == 0)
*pad = p2;
else
return PXE_BAD_OPTION;
if (s_pad != NULL)
{
- if (!strcmp(s_pad, "pkcs"))
+ if (strcmp(s_pad, "pkcs") == 0)
cx->padding = 1;
- else if (!strcmp(s_pad, "none"))
+ else if (strcmp(s_pad, "none") == 0)
cx->padding = 0;
else
goto err1;
*/
if (port->hba->krb_realm && strlen(port->hba->krb_realm))
{
- if (pg_strcasecmp(port->hba->krb_realm, domainname))
+ if (pg_strcasecmp(port->hba->krb_realm, domainname) != 0)
{
elog(DEBUG2,
"SSPI domain (%s) and configured domain (%s) don't match",
do
{
- if (!strncmp(str, k->name, k->len))
+ if (strncmp(str, k->name, k->len) == 0)
return k;
k++;
if (!k->name)
if (s->type != type)
continue;
- if (!strncmp(str, s->name, s->len))
+ if (strncmp(str, s->name, s->len) == 0)
return s;
}
return NULL;
conflines = replace_token(conflines,
"@authcomment@",
- strcmp(authmethod, "trust") ? "" : AUTHTRUST_WARNING);
+ strcmp(authmethod, "trust") != 0 ? "" : AUTHTRUST_WARNING);
/* Replace username for replication */
conflines = replace_token(conflines,
authmethod = "trust";
}
- if (strcmp(authmethod, "md5") &&
- strcmp(authmethod, "peer") &&
- strcmp(authmethod, "ident") &&
- strcmp(authmethod, "trust") &&
+ if (strcmp(authmethod, "md5") != 0 &&
+ strcmp(authmethod, "peer") != 0 &&
+ strcmp(authmethod, "ident") != 0 &&
+ strcmp(authmethod, "trust") != 0 &&
#ifdef USE_PAM
- strcmp(authmethod, "pam") &&
- strncmp(authmethod, "pam ", 4) && /* pam with space = param */
+ strcmp(authmethod, "pam") != 0 &&
+ strncmp(authmethod, "pam ", 4) != 0 && /* pam with space = param */
#endif
- strcmp(authmethod, "crypt") &&
- strcmp(authmethod, "password")
+ strcmp(authmethod, "crypt") != 0 &&
+ strcmp(authmethod, "password") != 0
)
/*
exit(1);
}
- if ((!strcmp(authmethod, "md5") ||
- !strcmp(authmethod, "crypt") ||
- !strcmp(authmethod, "password")) &&
+ if ((strcmp(authmethod, "md5") == 0 ||
+ strcmp(authmethod, "crypt") == 0 ||
+ strcmp(authmethod, "password") == 0) &&
!(pwprompt || pwfilename))
{
fprintf(stderr, _("%s: must specify a password for the superuser to enable %s authentication\n"), progname, authmethod);
log,
seg;
- if (!strcmp(dirent->d_name, ".") || !strcmp(dirent->d_name, ".."))
+ if (strcmp(dirent->d_name, ".") == 0 || strcmp(dirent->d_name, "..") == 0)
continue;
/* xlog files are always 24 characters */
if (registration)
{
- if (pg_strcasecmp(cmdLine + strlen(cmdLine) - 4, ".exe"))
+ if (pg_strcasecmp(cmdLine + strlen(cmdLine) - 4, ".exe") != 0)
{
/* If commandline does not end in .exe, append it */
strcat(cmdLine, ".exe");
static void
set_sig(char *signame)
{
- if (!strcmp(signame, "HUP"))
+ if (strcmp(signame, "HUP") == 0)
sig = SIGHUP;
- else if (!strcmp(signame, "INT"))
+ else if (strcmp(signame, "INT") == 0)
sig = SIGINT;
- else if (!strcmp(signame, "QUIT"))
+ else if (strcmp(signame, "QUIT") == 0)
sig = SIGQUIT;
- else if (!strcmp(signame, "ABRT"))
+ else if (strcmp(signame, "ABRT") == 0)
sig = SIGABRT;
-
- /*
- * probably should NOT provide SIGKILL
- *
- * else if (!strcmp(signame,"KILL")) sig = SIGKILL;
- */
- else if (!strcmp(signame, "TERM"))
+#if 0
+ /* probably should NOT provide SIGKILL */
+ else if (strcmp(signame,"KILL") == 0)
+ sig = SIGKILL;
+#endif
+ else if (strcmp(signame, "TERM") == 0)
sig = SIGTERM;
- else if (!strcmp(signame, "USR1"))
+ else if (strcmp(signame, "USR1") == 0)
sig = SIGUSR1;
- else if (!strcmp(signame, "USR2"))
+ else if (strcmp(signame, "USR2") == 0)
sig = SIGUSR2;
else
{
}
/* Show lengths on bpchar and varchar */
- if (!strcmp(typname, "bpchar"))
+ if (strcmp(typname, "bpchar") == 0)
{
int len = (typmod - VARHDRSZ);
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)
/* Complete LOCK [TABLE] <table> with "IN" */
else if ((pg_strcasecmp(prev2_wd, "LOCK") == 0 &&
- pg_strcasecmp(prev_wd, "TABLE")) ||
+ pg_strcasecmp(prev_wd, "TABLE") != 0) ||
(pg_strcasecmp(prev2_wd, "TABLE") == 0 &&
pg_strcasecmp(prev3_wd, "LOCK") == 0))
COMPLETE_WITH_CONST("IN");
static bool
check_special_value(char *ptr, double *retval, char **endptr)
{
- if (!pg_strncasecmp(ptr, "NaN", 3))
+ if (pg_strncasecmp(ptr, "NaN", 3) == 0)
{
*retval = get_float8_nan();
*endptr = ptr + 3;
return true;
}
- else if (!pg_strncasecmp(ptr, "Infinity", 8))
+ else if (pg_strncasecmp(ptr, "Infinity", 8) == 0)
{
*retval = get_float8_infinity();
*endptr = ptr + 8;
return true;
}
- else if (!pg_strncasecmp(ptr, "-Infinity", 9))
+ else if (pg_strncasecmp(ptr, "-Infinity", 9) == 0)
{
*retval = -get_float8_infinity();
*endptr = ptr + 9;
ecpg_init_sqlca(sqlca);
for (desc = get_descriptors(), prev = NULL; desc; prev = desc, desc = desc->next)
{
- if (!strcmp(name, desc->name))
+ if (strcmp(name, desc->name) == 0)
{
if (prev)
prev->next = desc->next;
ecpg_log("ecpg_execute on line %d: OK: %s\n", stmt->lineno, cmdstat);
if (stmt->compat != ECPG_COMPAT_INFORMIX_SE &&
!sqlca->sqlerrd[2] &&
- (!strncmp(cmdstat, "UPDATE", 6)
- || !strncmp(cmdstat, "INSERT", 6)
- || !strncmp(cmdstat, "DELETE", 6)))
+ (strncmp(cmdstat, "UPDATE", 6) == 0
+ || strncmp(cmdstat, "INSERT", 6) == 0
+ || strncmp(cmdstat, "DELETE", 6) == 0))
ecpg_raise(stmt->lineno, ECPG_NOT_FOUND, ECPG_SQLSTATE_NO_DATA, NULL);
break;
case PGRES_COPY_OUT:
{
if (stmtCacheEntries[entNo].stmtID[0]) /* check if entry is in use */
{
- if (!strcmp(ecpgQuery, stmtCacheEntries[entNo].ecpgQuery))
+ if (strcmp(ecpgQuery, stmtCacheEntries[entNo].ecpgQuery) == 0)
break; /* found it */
}
++entNo; /* incr entry # */
for (i = descriptors; i; lastptr = &i->next, i = i->next)
{
- if (!strcmp(name, i->name))
+ if (strcmp(name, i->name) == 0)
{
if ((!connection && !i->connection)
|| (connection && i->connection
- && !strcmp(connection, i->connection)))
+ && strcmp(connection, i->connection) == 0))
{
*lastptr = i->next;
if (i->connection)
for (i = descriptors; i; i = i->next)
{
- if (!strcmp(name, i->name))
+ if (strcmp(name, i->name) == 0)
{
if ((!connection && !i->connection)
|| (connection && i->connection
- && !strcmp(connection, i->connection)))
+ && strcmp(connection, i->connection) == 0))
return i;
}
}
{
const char *con = connection ? connection : "NULL";
- if (!strcmp($1, "all"))
+ if (strcmp($1, "all") == 0)
fprintf(yyout, "{ ECPGdeallocate_all(__LINE__, %d, %s);", compat, con);
else if ($1[0] == ':')
fprintf(yyout, "{ ECPGdeallocate(__LINE__, %d, %s, %s);", compat, con, $1+1);
skip_set_var = true;
}
else if ((ptr->variable->type->type == ECPGt_char_variable)
- && (!strncmp(ptr->variable->name, "ECPGprepared_statement", strlen("ECPGprepared_statement"))))
+ && (strncmp(ptr->variable->name, "ECPGprepared_statement", strlen("ECPGprepared_statement")) == 0))
{
newvar = ptr->variable;
skip_set_var = true;
/* This tests whether the cursor was declared and opened in the same function. */
#define SAMEFUNC(cur) \
((cur->function == NULL) || \
- (cur->function != NULL && !strcmp(cur->function, current_function)))
+ (cur->function != NULL && strcmp(cur->function, current_function) == 0))
static struct cursor *
add_additional_variables(char *name, bool insert)
{
const char *con = connection ? connection : "NULL";
- if (strcmp(name, "all"))
+ if (strcmp(name, "all") != 0)
{
fprintf(yyout, "{ ECPGdeallocate(__LINE__, %d, %s, ", compat, con);
output_escaped_str(name, true);
yyin = fopen(inc_file, "r");
if (!yyin)
{
- if (strcmp(inc_file + strlen(inc_file) - 2, ".h"))
+ if (strcmp(inc_file + strlen(inc_file) - 2, ".h") != 0)
{
strcat(inc_file, ".h");
yyin = fopen(inc_file, "r");
yyin = fopen(inc_file, "r");
if (!yyin)
{
- if (strcmp(inc_file + strlen(inc_file) - 2, ".h"))
+ if (strcmp(inc_file + strlen(inc_file) - 2, ".h") != 0)
{
strcat(inc_file, ".h");
yyin = fopen( inc_file, "r" );
if ((var->type->type != type->type) ||
(var->type->type_name && !type->type_name) ||
(!var->type->type_name && type->type_name) ||
- (var->type->type_name && type->type_name && strcmp(var->type->type_name, type->type_name)))
+ (var->type->type_name && type->type_name && strcmp(var->type->type_name, type->type_name) != 0))
mmerror(PARSE_ERROR, ET_ERROR, "variable \"%s\" is hidden by a local variable of a different type", name);
else if (var->brace_level != brace_level)
mmerror(PARSE_ERROR, ET_WARNING, "variable \"%s\" is hidden by a local variable", name);
if ((var->type->type != ind_type->type) ||
(var->type->type_name && !ind_type->type_name) ||
(!var->type->type_name && ind_type->type_name) ||
- (var->type->type_name && ind_type->type_name && strcmp(var->type->type_name, ind_type->type_name)))
+ (var->type->type_name && ind_type->type_name && strcmp(var->type->type_name, ind_type->type_name) != 0))
mmerror(PARSE_ERROR, ET_ERROR, "indicator variable \"%s\" is hidden by a local variable of a different type", ind_name);
else if (var->brace_level != ind_brace_level)
mmerror(PARSE_ERROR, ET_WARNING, "indicator variable \"%s\" is hidden by a local variable", ind_name);
{
struct typedefs *this;
- for (this = types; this && strcmp(this->name, name); this = this->next);
+ for (this = types; this && strcmp(this->name, name) != 0; this = this->next);
if (!this)
mmerror(PARSE_ERROR, ET_FATAL, "unrecognized data type name \"%s\"", name);
{
fname = PQgetvalue(res, n, 0);
foid = (Oid) atoi(PQgetvalue(res, n, 1));
- if (!strcmp(fname, "lo_open"))
+ if (strcmp(fname, "lo_open") == 0)
lobjfuncs->fn_lo_open = foid;
- else if (!strcmp(fname, "lo_close"))
+ else if (strcmp(fname, "lo_close") == 0)
lobjfuncs->fn_lo_close = foid;
- else if (!strcmp(fname, "lo_creat"))
+ else if (strcmp(fname, "lo_creat") == 0)
lobjfuncs->fn_lo_creat = foid;
- else if (!strcmp(fname, "lo_create"))
+ else if (strcmp(fname, "lo_create") == 0)
lobjfuncs->fn_lo_create = foid;
- else if (!strcmp(fname, "lo_unlink"))
+ else if (strcmp(fname, "lo_unlink") == 0)
lobjfuncs->fn_lo_unlink = foid;
- else if (!strcmp(fname, "lo_lseek"))
+ else if (strcmp(fname, "lo_lseek") == 0)
lobjfuncs->fn_lo_lseek = foid;
- else if (!strcmp(fname, "lo_tell"))
+ else if (strcmp(fname, "lo_tell") == 0)
lobjfuncs->fn_lo_tell = foid;
- else if (!strcmp(fname, "lo_truncate"))
+ else if (strcmp(fname, "lo_truncate") == 0)
lobjfuncs->fn_lo_truncate = foid;
- else if (!strcmp(fname, "loread"))
+ else if (strcmp(fname, "loread") == 0)
lobjfuncs->fn_lo_read = foid;
- else if (!strcmp(fname, "lowrite"))
+ else if (strcmp(fname, "lowrite") == 0)
lobjfuncs->fn_lo_write = foid;
}