return (G.instance_list != NULL);
for (inst = G.instance_list; inst; inst = inst->next) {
- if (!inst->base_device || !strcmp(base, inst->base_device)) {
+ if (!inst->base_device || strcmp(base, inst->base_device) == 0) {
free(base);
return 1;
}
// Figure out which line of hunk to compare with next. (Skip lines
// of the hunk we'd be adding.)
while (plist && *plist->data == "+-"[reverse]) {
- if (data && !strcmp(data, plist->data+1)) {
+ if (data && strcmp(data, plist->data+1) == 0) {
if (!backwarn) {
backwarn = TT.linenum;
if (option_mask32 & FLAG_IGNORE) {
for (;;) {
while (plist && *plist->data == "+-"[reverse]) {
- if (!strcmp(check->data, plist->data+1) &&
- !backwarn) {
+ if (strcmp(check->data, plist->data+1) == 0
+ && !backwarn
+ ) {
backwarn = TT.linenum;
if (option_mask32 & FLAG_IGNORE) {
dummy_revert = 1;
// We're deleting oldname if new file is /dev/null (before -p)
// or if new hunk is empty (zero context) after patching
- if (!strcmp(name, "/dev/null") || !(reverse ? oldsum : newsum)) {
+ if (strcmp(name, "/dev/null") == 0 || !(reverse ? oldsum : newsum)) {
name = reverse ? newname : oldname;
empty = 1;
}
struct stat statbuf;
// If the old file was null, we're creating a new one.
- if (!strcmp(oldname, "/dev/null") || !oldsum) {
+ if (strcmp(oldname, "/dev/null") == 0 || !oldsum) {
printf("creating %s\n", name);
s = strrchr(name, '/');
if (s) {
// Figure out which line of hunk to compare with next. (Skip lines
// of the hunk we'd be adding.)
while (plist && *plist->data == "+-"[reverse]) {
- if (data && !strcmp(data, plist->data+1)) {
+ if (data && strcmp(data, plist->data+1) == 0) {
if (!backwarn) {
fdprintf(2,"Possibly reversed hunk %d at %ld\n",
TT.hunknum, TT.linenum);
// We're deleting oldname if new file is /dev/null (before -p)
// or if new hunk is empty (zero context) after patching
- if (!strcmp(name, "/dev/null") || !(reverse ? oldsum : newsum))
- {
+ if (strcmp(name, "/dev/null") == 0 || !(reverse ? oldsum : newsum)) {
name = reverse ? newname : oldname;
del++;
}
// If we've got a file to open, do so.
} else if (!(option_mask32 & FLAG_PATHLEN) || i <= TT.prefix) {
// If the old file was null, we're creating a new one.
- if (!strcmp(oldname, "/dev/null") || !oldsum) {
+ if (strcmp(oldname, "/dev/null") == 0 || !oldsum) {
printf("creating %s\n", name);
s = strrchr(name, '/');
if (s) {
sed_cmd_t *sed_cmd;
for (sed_cmd = G.sed_cmd_head; sed_cmd; sed_cmd = sed_cmd->next) {
- if (sed_cmd->cmd == ':' && sed_cmd->string && !strcmp(sed_cmd->string, label)) {
+ if (sed_cmd->cmd == ':'
+ && sed_cmd->string
+ && strcmp(sed_cmd->string, label) == 0
+ ) {
return sed_cmd;
}
}
gr = xgetgrnam(argv[1]); /* unknown group: exit */
/* check if user is already in this group */
for (; *(gr->gr_mem) != NULL; (gr->gr_mem)++) {
- if (!strcmp(argv[0], *(gr->gr_mem))) {
+ if (strcmp(argv[0], *(gr->gr_mem)) == 0) {
/* user is already in group: do nothing */
return EXIT_SUCCESS;
}
sprintf(full_name_inc, count ? "%s%u" : "%s", full_name, i);
rdev = makedev(major, minor + (i - start) * increment);
if (mknod(full_name_inc, mode, rdev) != 0
- && errno != EEXIST
+ && errno != EEXIST
) {
bb_perror_msg("line %d: can't create node %s", linenum, full_name_inc);
ret = EXIT_FAILURE;
&& blockBuf[blockLength - 3] == PAD
) {
while (blockLength
- && blockBuf[blockLength - 1] == PAD
+ && blockBuf[blockLength - 1] == PAD
) {
blockLength--;
}
afp = aftypes;
while (*afp != NULL) {
- if (!strcmp((*afp)->name, name))
+ if (strcmp((*afp)->name, name) == 0)
return (*afp);
afp++;
}
ife = add_interface(name);
get_dev_fields(s, ife, procnetdev_vsn);
ife->statistics_valid = 1;
- if (target && !strcmp(target, name))
+ if (target && strcmp(target, name) == 0)
break;
}
if (ferror(fh)) {
hwp = hwtypes;
while (*hwp != NULL) {
- if (!strcmp((*hwp)->name, name))
+ if (strcmp((*hwp)->name, name) == 0)
return (*hwp);
hwp++;
}
addr6p[5], addr6p[6], addr6p[7], &if_idx, &plen, &scope,
&dad_status, devname) != EOF
) {
- if (!strcmp(devname, ptr->name)) {
+ if (strcmp(devname, ptr->name) == 0) {
sprintf(addr6, "%s:%s:%s:%s:%s:%s:%s:%s",
addr6p[0], addr6p[1], addr6p[2], addr6p[3],
addr6p[4], addr6p[5], addr6p[6], addr6p[7]);
char *p;
maj = TC_H_UNSPEC;
- if (!strcmp(str, "none"))
+ if (strcmp(str, "none") == 0)
goto ok;
maj = strtoul(str, &p, 16);
if (p == str)
char *p;
maj = TC_H_ROOT;
- if (!strcmp(str, "root"))
+ if (strcmp(str, "root") == 0)
goto ok;
maj = TC_H_UNSPEC;
- if (!strcmp(str, "none"))
+ if (strcmp(str, "none") == 0)
goto ok;
maj = strtoul(str, &p, 16);
if (p == str) {
if (ppid2match >= 0 && ppid2match != proc->ppid)
continue;
- if (sid2match >= 0 && sid2match != proc->sid)
+ if (sid2match >= 0 && sid2match != proc->sid)
continue;
/* NB: OPT_INVERT is always 0 or 1 */
#define INIT_G() do { setup_common_bufsiz(); } while (0)
-#define str_equal(s,t) (!strcmp((s), (t)))
+#define str_equal(s,t) (strcmp((s), (t)) == 0)
static void fatal_cannot(const char *m1) NORETURN;
static void set_shell(const char *new_shell)
{
- if (!strcmp(new_shell, "bash") || !strcmp(new_shell, "sh"))
+ if (strcmp(new_shell, "bash") == 0 || strcmp(new_shell, "sh") == 0)
return;
- if (!strcmp(new_shell, "tcsh") || !strcmp(new_shell, "csh"))
+ if (strcmp(new_shell, "tcsh") == 0 || strcmp(new_shell, "csh") == 0)
option_mask32 |= SHELL_IS_TCSH;
else
bb_error_msg("unknown shell '%s', assuming bash", new_shell);
bb_error_msg_and_die("%s(%i): wrong map line",
mapFile, maplineno);
- if (!strcmp(fn_name, "_stext")) /* only elf works like this */ {
+ if (strcmp(fn_name, "_stext") == 0) /* only elf works like this */ {
add0 = fn_add;
break;
}
if (optBins) {
if (optVerbose || this > 0)
printf(" total\t\t\t\t%u\n", this);
- } else if ((this || optAll)
- && (fn_len = next_add-fn_add) != 0
+ } else
+ if ((this || optAll)
+ && (fn_len = next_add-fn_add) != 0
) {
if (optVerbose)
printf("%016llx %-40s %6u %8.4f\n", fn_add,