remove one band from a recent attempted warning correction
This commit is contained in:
@@ -377,6 +377,7 @@ curses_str_remainder(const char *str, int width, int line_num)
|
|||||||
int strsize = strlen(str) + 1;
|
int strsize = strlen(str) + 1;
|
||||||
#if __STDC_VERSION__ >= 199901L
|
#if __STDC_VERSION__ >= 199901L
|
||||||
char substr[strsize];
|
char substr[strsize];
|
||||||
|
char curstr[strsize];
|
||||||
char tmpstr[strsize];
|
char tmpstr[strsize];
|
||||||
|
|
||||||
strcpy(substr, str);
|
strcpy(substr, str);
|
||||||
@@ -385,6 +386,7 @@ curses_str_remainder(const char *str, int width, int line_num)
|
|||||||
#define BUFSZ 256
|
#define BUFSZ 256
|
||||||
#endif
|
#endif
|
||||||
char substr[BUFSZ * 2];
|
char substr[BUFSZ * 2];
|
||||||
|
char curstr[BUFSZ * 2];
|
||||||
char tmpstr[BUFSZ * 2];
|
char tmpstr[BUFSZ * 2];
|
||||||
|
|
||||||
if (strsize > (BUFSZ * 2) - 1) {
|
if (strsize > (BUFSZ * 2) - 1) {
|
||||||
@@ -412,6 +414,10 @@ curses_str_remainder(const char *str, int width, int line_num)
|
|||||||
if (last_space == 0) { /* No spaces found */
|
if (last_space == 0) { /* No spaces found */
|
||||||
last_space = count - 1;
|
last_space = count - 1;
|
||||||
}
|
}
|
||||||
|
for (count = 0; count < last_space; count++) {
|
||||||
|
curstr[count] = substr[count];
|
||||||
|
}
|
||||||
|
curstr[count] = '\0';
|
||||||
if (substr[count] == '\0') {
|
if (substr[count] == '\0') {
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user