Replace bare ";" in the body of for() loops with "continue;" for
improved readability.
This commit is contained in:
@@ -49,7 +49,7 @@ sudo_strlcpy(char *dst, const char *src, size_t dsize)
|
||||
if (dsize != 0)
|
||||
*dst = '\0'; /* NUL-terminate dst */
|
||||
while (*src++)
|
||||
;
|
||||
continue;
|
||||
}
|
||||
|
||||
return(src - osrc - 1); /* count does not include NUL */
|
||||
|
@@ -30,7 +30,7 @@ sudo_strnlen(const char *str, size_t maxlen)
|
||||
const char *cp;
|
||||
|
||||
for (cp = str; maxlen != 0 && *cp != '\0'; cp++, maxlen--)
|
||||
;
|
||||
continue;
|
||||
|
||||
return (size_t)(cp - str);
|
||||
}
|
||||
|
@@ -867,7 +867,7 @@ store_syslogfac(const char *val, struct sudo_defs_types *def)
|
||||
debug_return_bool(true);
|
||||
}
|
||||
for (fac = facilities; fac->name && strcmp(val, fac->name); fac++)
|
||||
;
|
||||
continue;
|
||||
if (fac->name == NULL)
|
||||
debug_return_bool(false); /* not found */
|
||||
|
||||
@@ -882,7 +882,7 @@ logfac2str(int n)
|
||||
debug_decl(logfac2str, SUDOERS_DEBUG_DEFAULTS)
|
||||
|
||||
for (fac = facilities; fac->name && fac->num != n; fac++)
|
||||
;
|
||||
continue;
|
||||
debug_return_const_str(fac->name);
|
||||
}
|
||||
|
||||
@@ -896,7 +896,7 @@ store_syslogpri(const char *val, struct sudo_defs_types *def)
|
||||
debug_return_bool(false);
|
||||
|
||||
for (pri = priorities; pri->name && strcmp(val, pri->name); pri++)
|
||||
;
|
||||
continue;
|
||||
if (pri->name == NULL)
|
||||
debug_return_bool(false); /* not found */
|
||||
|
||||
@@ -911,7 +911,7 @@ logpri2str(int n)
|
||||
debug_decl(logpri2str, SUDOERS_DEBUG_DEFAULTS)
|
||||
|
||||
for (pri = priorities; pri->name && pri->num != n; pri++)
|
||||
;
|
||||
continue;
|
||||
debug_return_const_str(pri->name);
|
||||
}
|
||||
|
||||
|
@@ -448,7 +448,7 @@ sudo_setenv_nodebug(const char *var, const char *val, int overwrite)
|
||||
* just ignores the '=' and anything after it.
|
||||
*/
|
||||
for (cp = var; *cp && *cp != '='; cp++)
|
||||
;
|
||||
continue;
|
||||
esize = (size_t)(cp - var) + 2;
|
||||
if (val) {
|
||||
esize += strlen(val); /* glibc treats a NULL val as "" */
|
||||
@@ -1199,7 +1199,7 @@ read_env_file(const char *path, int overwrite)
|
||||
|
||||
/* Must be of the form name=["']value['"] */
|
||||
for (val = var; *val != '\0' && *val != '='; val++)
|
||||
;
|
||||
continue;
|
||||
if (var == val || *val != '=')
|
||||
continue;
|
||||
var_len = (size_t)(val - var);
|
||||
|
@@ -122,7 +122,7 @@ do_syslog(int pri, char *msg)
|
||||
|
||||
/* Advance p and eliminate leading whitespace */
|
||||
for (p = tmp; *p == ' '; p++)
|
||||
;
|
||||
continue;
|
||||
} else {
|
||||
mysyslog(pri, fmt, user_name, p);
|
||||
p += len;
|
||||
|
@@ -573,13 +573,13 @@ print_defaults_list_json(FILE *fp, struct defaults *def, int indent)
|
||||
do {
|
||||
/* Remove leading blanks, must have a non-empty string. */
|
||||
for (start = end; isblank((unsigned char)*start); start++)
|
||||
;
|
||||
continue;
|
||||
if (*start == '\0')
|
||||
break;
|
||||
|
||||
/* Find the end and print it. */
|
||||
for (end = start; *end && !isblank((unsigned char)*end); end++)
|
||||
;
|
||||
continue;
|
||||
savech = *end;
|
||||
*end = '\0';
|
||||
print_string_json(fp, start);
|
||||
|
@@ -160,7 +160,7 @@ rpl_setenv(const char *var, const char *val, int overwrite)
|
||||
* just ignores the '=' and anything after it.
|
||||
*/
|
||||
for (src = var; *src != '\0' && *src != '='; src++)
|
||||
;
|
||||
continue;
|
||||
esize = (size_t)(src - var) + 2;
|
||||
if (val) {
|
||||
esize += strlen(val); /* glibc treats a NULL val as "" */
|
||||
|
@@ -1557,7 +1557,7 @@ exec_pty(struct command_details *details,
|
||||
/* Wait for parent to grant us the tty if we are foreground. */
|
||||
if (foreground && !ISSET(details->flags, CD_EXEC_BG)) {
|
||||
while (tcgetpgrp(io_fds[SFD_SLAVE]) != self)
|
||||
; /* spin */
|
||||
continue; /* spin */
|
||||
}
|
||||
|
||||
/* We have guaranteed that the slave fd is > 2 */
|
||||
|
Reference in New Issue
Block a user