--- /dev/null
+@@
+expression e;
+statement s;
+@@
+- if (e == NULL)
++ if (!e)
+s
+@@
+expression e;
+statement s;
+@@
+- if (e != NULL)
++ if (e)
+s
}
static int verify_executable(Unit *u, ExecCommand *exec) {
- if (exec == NULL)
+ if (!exec)
return 0;
if (access(exec->path, X_OK) < 0)
continue;
t->name = strdup(u.id);
- if (t->name == NULL) {
+ if (!t->name) {
r = log_oom();
goto fail;
}
assert(deps);
path = unit_dbus_path_from_name(name);
- if (path == NULL)
+ if (!path)
return -ENOMEM;
return bus_get_unit_property_strv(bus, path, "After", deps);
}
}
- if (service_longest == 0 )
+ if (service_longest == 0)
return r;
STRV_FOREACH(c, deps) {
assert(bus);
path = unit_dbus_path_from_name(name);
- if (path == NULL)
+ if (!path)
return -ENOMEM;
r = sd_bus_get_property(
int clock_is_localtime(const char* adjtime_path) {
_cleanup_fclose_ FILE *f;
- if (adjtime_path == NULL)
+ if (!adjtime_path)
adjtime_path = "/etc/adjtime";
/*
int encode_devnode_name(const char *str, char *str_enc, size_t len) {
size_t i, j;
- if (str == NULL || str_enc == NULL)
+ if (!str || !str_enc)
return -EINVAL;
for (i = 0, j = 0; str[i] != '\0'; i++) {
if (s[pos] == '\0') \
break; \
hexoff = strchr(hex, s[pos]); \
- if (hexoff == NULL) \
+ if (!hexoff) \
break; \
assert(hexoff >= hex); \
x = hexoff - hex; \
sep = s[strspn(s, hex)];
if (sep == '\n')
return -EINVAL;
- if (strchr(":.-", sep) == NULL)
+ if (!strchr(":.-", sep))
return -EINVAL;
if (sep == '.') {
return r;
} else
- assert(ts == NULL);
+ assert(!ts);
if (flags & WRITE_STRING_FILE_CREATE) {
f = fopen(fn, "we");
if (!filename_is_valid(fn))
return -EINVAL;
- if (extra == NULL)
+ if (!extra)
extra = "";
t = new(char, strlen(p) + 2 + strlen(extra) + 6 + 1);
assert(imp->state == IMPORTER_STATE_LINE);
assert(imp->offset <= imp->filled);
assert(imp->filled <= imp->size);
- assert(imp->buf == NULL || imp->size > 0);
+ assert(!imp->buf || imp->size > 0);
assert(imp->fd >= 0);
for (;;) {
assert(size <= DATA_SIZE_MAX);
assert(imp->offset <= imp->filled);
assert(imp->filled <= imp->size);
- assert(imp->buf != NULL || imp->size == 0);
- assert(imp->buf == NULL || imp->size > 0);
+ assert(imp->buf || imp->size == 0);
+ assert(!imp->buf || imp->size > 0);
assert(imp->fd >= 0);
assert(data);
assert(timestamp);
- if (paths == NULL)
+ if (!paths)
return false;
STRV_FOREACH(i, paths) {
if (last_space != NULL && timezone_is_valid(last_space + 1))
tz = last_space + 1;
- if (tz == NULL || endswith_no_case(t, " UTC"))
+ if (!tz || endswith_no_case(t, " UTC"))
return parse_timestamp_impl(t, usec, false);
shared = mmap(NULL, sizeof *shared, PROT_READ|PROT_WRITE, MAP_SHARED|MAP_ANONYMOUS, -1, 0);
tcg_event = AllocateZeroPool(desc_len + sizeof(TCG_PCR_EVENT));
- if (tcg_event == NULL)
+ if (!tcg_event)
return EFI_OUT_OF_RESOURCES;
tcg_event->EventSize = desc_len;
tcg_event = AllocateZeroPool(sizeof(*tcg_event) - sizeof(tcg_event->Event) + desc_len + 1);
- if (tcg_event == NULL)
+ if (!tcg_event)
return EFI_OUT_OF_RESOURCES;
tcg_event->Size = sizeof(*tcg_event) - sizeof(tcg_event->Event) + desc_len + 1;
p = strv_env_clean_with_callback(p, invalid_env, &info);
}
- if (r == NULL)
+ if (!r)
r = p;
else {
char **m;
int r;
assert(shutdown_verb);
- assert(command_line[pos] == NULL);
+ assert(!command_line[pos]);
env_block = strv_copy(environ);
xsprintf(log_level, "%d", log_get_max_level());
continue;
fdinfo = fdopen(fd, "re");
- if (fdinfo == NULL) {
+ if (!fdinfo) {
close(fd);
continue;
}
int ret_fd, r, err = 0;
path = new(char, sizeof("/dev/tty63"));
- if (path == NULL)
+ if (!path)
return log_oom();
for (i = 1; i <= 63; i++) {
return log_error_errno(r, "Virtual console %s is not in K_XLATE or K_UNICODE: %m", src_vc);
path = strdup(src_vc);
- if (path == NULL)
+ if (!path)
return log_oom();
*ret_path = path;