Skip to content

Commit 3c898c6

Browse files
author
Bernd Eckenfels
committed
interface.c: use ASCII only
1 parent 024814e commit 3c898c6

File tree

1 file changed

+7
-7
lines changed

1 file changed

+7
-7
lines changed

lib/interface.c

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -211,17 +211,17 @@ static int if_readconf(void)
211211
}
212212

213213
static const char *get_name(char *name, const char *p)
214-
/* Safe version guarantees at most IFNAMSIZ1 bytes are copied
215-
and the destination buffer is always NULterminated. */
214+
/* Safe version - guarantees at most IFNAMSIZ-1 bytes are copied
215+
and the destination buffer is always NUL-terminated. */
216216
{
217217
char *dst = name; /* current write ptr */
218218
const char *end = name + IFNAMSIZ - 1; /* last byte we may write */
219219

220-
/* Skip leading whitespace. */
220+
/* Skip leading white-space. */
221221
while (isspace((unsigned char)*p))
222222
++p;
223223

224-
/* Copy until whitespace, end of string, or buffer full. */
224+
/* Copy until white-space, end of string, or buffer full. */
225225
while (*p && !isspace((unsigned char)*p) && dst < end) {
226226
if (*p == ':') { /* possible alias veth0:123: */
227227
const char *dot = p; /* remember the colon */
@@ -244,13 +244,13 @@ static const char *get_name(char *name, const char *p)
244244
}
245245
if (*p == ':') /* consume trailing colon */
246246
++p;
247-
break; /* interface name ends here */
247+
break; /* interface name ends here */
248248
}
249249

250-
*dst++ = *p++; /* ordinary character copy */
250+
*dst++ = *p++; /* ordinary character copy */
251251
}
252252

253-
*dst = '\0'; /* always NULterminate */
253+
*dst = '\0'; /* always NUL-terminate */
254254
return p;
255255
}
256256

0 commit comments

Comments
 (0)