Project

General

Profile

Bug #14893 ยป 1904.patch

take-cheeze (Takeshi Watanabe), 07/03/2018 12:31 PM

View differences:

signal.c
206 206
    const char *nm;
207 207
    long len;
208 208
    int prefix = 0;
209
    size_t left_len;
209 210

  
210 211
    if (RB_SYMBOL_P(vsig)) {
211 212
	*sig_ptr = vsig = rb_sym2str(vsig);
......
258 259
    }
259 260

  
260 261
    if (prefix_ptr) *prefix_ptr = prefix;
262
    left_len = len - prefix;
261 263
    for (sigs = siglist + !exit; sigs->signm; sigs++) {
262
	if (memcmp(sigs->signm, nm + prefix, len - prefix) == 0 &&
264
	if (left_len != strlen(sigs->signm)) { continue; }
265
	if (memcmp(sigs->signm, nm + prefix, left_len) == 0 &&
263 266
	    sigs->signm[len - prefix] == '\0') {
264 267
	    return negative ? -sigs->signo : sigs->signo;
265 268
	}