Replace bare ";" in the body of for() loops with "continue;" for

improved readability.
This commit is contained in:
Todd C. Miller
2016-10-26 10:42:28 -06:00
parent f9d6777755
commit fc1b4155d7
8 changed files with 13 additions and 13 deletions

View File

@@ -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 */

View File

@@ -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);
}

View File

@@ -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);
}

View File

@@ -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);

View File

@@ -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;

View File

@@ -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);

View File

@@ -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 "" */

View File

@@ -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 */