commit - 9e26f05792286fa1ff16e43516f1f4a688b672b9
commit + 102d840de78061d9f313aaa557ef64f586932143
blob - f450103ce056eeb7549745d5e9be8faf481f5f20
blob + ec4f8ac963eafff2950257bc022d8c5ab5f86a99
--- got/got.c
+++ got/got.c
* unveil(2) traverses exec(2); if an editor is used we have
* to apply unveil after the log message has been written.
*/
- if (logmsg == NULL || strlen(logmsg) == 0) {
+ if (logmsg == NULL || *logmsg == '\0') {
error = get_editor(&editor);
if (error)
goto done;
size_t len;
/* if a message was specified on the command line, just use it */
- if (a->cmdline_log != NULL && strlen(a->cmdline_log) != 0) {
+ if (a->cmdline_log != NULL && *a->cmdline_log != '\0') {
len = strlen(a->cmdline_log) + 1;
*logmsg = malloc(len + 1);
if (*logmsg == NULL)
blob - 6eed5edbe0ca8a4cc8d06fe1e24cf4c71e7648f6
blob + 1941a98fb622f228478b023b38875d38fd7d1561
--- gotwebd/config.c
+++ gotwebd/config.c
sock->conf.af_type == AF_UNIX ? "unix" :
(sock->conf.af_type == AF_INET ? "inet" :
(sock->conf.af_type == AF_INET6 ? "inet6" : "unknown")),
- strlen(sock->conf.unix_socket_name) ?
+ *sock->conf.unix_socket_name != '\0' ?
sock->conf.unix_socket_name : "none");
return 0;
blob - d87c6a8af195b8ced89fc29785a307e6156dba73
blob + d9bca1235cd0b28e27421abbdb85d29d125bd3f1
--- gotwebd/got_operations.c
+++ gotwebd/got_operations.c
TAILQ_INIT(&refs);
- if (qs->file != NULL && strlen(qs->file) > 0)
+ if (qs->file != NULL && *qs->file != '\0')
if (asprintf(&file_path, "%s/%s", qs->folder ? qs->folder : "",
qs->file) == -1)
return got_error_from_errno("asprintf");
if (error)
goto done;
- if (qs->file != NULL && strlen(qs->file) > 0) {
+ if (qs->file != NULL && *qs->file != '\0') {
error = got_commit_graph_open(&graph, file_path, 0);
if (error)
goto done;
blob - d2716733267224b36363cf613d239bbbafff2239
blob + 59ca5bf55c49c212f0bcd9008f72ca685cfed645
--- gotwebd/gotweb.c
+++ gotwebd/gotweb.c
struct server *srv = NULL;
/* check against the server name first */
- if (strlen(server_name) > 0)
+ if (*server_name != '\0')
TAILQ_FOREACH(srv, &gotwebd_env->servers, entry)
if (strcmp(srv->name, server_name) == 0)
goto done;
/* check against subdomain second */
- if (strlen(subdomain) > 0)
+ if (*subdomain != '\0')
TAILQ_FOREACH(srv, &gotwebd_env->servers, entry)
if (strcmp(srv->name, subdomain) == 0)
goto done;
}
break;
case INDEX_PAGE:
- if (strlen(value) == 0)
+ if (*value == '\0')
break;
(*qs)->index_page = strtonum(value, INT64_MIN,
INT64_MAX, &errstr);
}
break;
case PAGE:
- if (strlen(value) == 0)
+ if (*value == '\0')
break;
(*qs)->page = strtonum(value, INT64_MIN,
INT64_MAX, &errstr);
blob - 771a0c2547f73ef4ea0982ca4f4d1c6310d39522
blob + 1b80500f53fe828051e897701a7d5eef582c9b91
--- gotwebd/sockets.c
+++ gotwebd/sockets.c
memcpy(&acp->ss, &a->ss, sizeof(acp->ss));
acp->ipproto = a->ipproto;
acp->port = a->port;
- if (strlen(a->ifname) != 0) {
+ if (*a->ifname != '\0') {
if (strlcpy(acp->ifname, a->ifname,
sizeof(acp->ifname)) >= sizeof(acp->ifname)) {
fatalx("%s: interface name truncated",