Add Strlen(), a strlen(3) that panics if string is stupid long and returns unsigned.
First batch of changes to use it to suppress warnings.
This commit is contained in:
@@ -748,7 +748,7 @@ str2role(const char *str)
|
||||
return ROLE_NONE;
|
||||
|
||||
/* Match as much of str as is provided */
|
||||
len = strlen(str);
|
||||
len = Strlen(str);
|
||||
for (i = 0; roles[i].name.m; i++) {
|
||||
/* Does it match the male name? */
|
||||
if (!strncmpi(str, roles[i].name.m, len))
|
||||
@@ -878,7 +878,7 @@ str2gend(const char *str)
|
||||
return ROLE_NONE;
|
||||
|
||||
/* Match as much of str as is provided */
|
||||
len = strlen(str);
|
||||
len = Strlen(str);
|
||||
for (i = 0; i < ROLE_GENDERS; i++) {
|
||||
/* Does it match the adjective? */
|
||||
if (!strncmpi(str, genders[i].adj, len))
|
||||
@@ -941,7 +941,7 @@ str2align(const char *str)
|
||||
return ROLE_NONE;
|
||||
|
||||
/* Match as much of str as is provided */
|
||||
len = strlen(str);
|
||||
len = Strlen(str);
|
||||
for (i = 0; i < ROLE_ALIGNS; i++) {
|
||||
/* Does it match the adjective? */
|
||||
if (!strncmpi(str, aligns[i].adj, len))
|
||||
@@ -1530,7 +1530,7 @@ build_plselection_prompt(
|
||||
Strcat(tmpbuf, "a ");
|
||||
/* <your> */
|
||||
|
||||
(void) root_plselection_prompt(eos(tmpbuf), buflen - strlen(tmpbuf),
|
||||
(void) root_plselection_prompt(eos(tmpbuf), buflen - Strlen(tmpbuf),
|
||||
rolenum, racenum, gendnum, alignnum);
|
||||
/* "Shall I pick a character's role, race, gender, and alignment for you?"
|
||||
plus " [ynaq] (y)" is a little too long for a conventional 80 columns;
|
||||
|
||||
Reference in New Issue
Block a user