… | |
… | |
3227 | rxvt_term::get_to_st (unicode_t &ends_how) |
3227 | rxvt_term::get_to_st (unicode_t &ends_how) |
3228 | { |
3228 | { |
3229 | unicode_t ch; |
3229 | unicode_t ch; |
3230 | bool seen_esc = false; |
3230 | bool seen_esc = false; |
3231 | unsigned int n = 0; |
3231 | unsigned int n = 0; |
3232 | wchar_t string[STRING_MAX]; |
3232 | wchar_t string[CBUFSIZ]; |
3233 | |
3233 | |
3234 | while ((ch = cmd_getc ()) != NOCHAR) |
3234 | while ((ch = cmd_getc ()) != NOCHAR) |
3235 | { |
3235 | { |
3236 | if (seen_esc) |
3236 | if (seen_esc) |
3237 | { |
3237 | { |
… | |
… | |
3252 | else if (ch < 0x20) |
3252 | else if (ch < 0x20) |
3253 | return NULL; /* other control character - exit */ |
3253 | return NULL; /* other control character - exit */ |
3254 | |
3254 | |
3255 | seen_esc = false; |
3255 | seen_esc = false; |
3256 | |
3256 | |
3257 | if (n >= STRING_MAX - 1) |
3257 | if (n >= sizeof (string) - 1) |
3258 | // stop at some sane length |
3258 | // stop at some sane length |
3259 | return NULL; |
3259 | return NULL; |
3260 | |
3260 | |
3261 | string[n++] = ch; |
3261 | string[n++] = ch; |
3262 | } |
3262 | } |