View | Details | Raw Unified | Return to bug 63576
Collapse All | Expand All

(-)src/softmagic.c.orig (-3 / +3 lines)
Lines 427-438 mconvert(struct magic_set *ms, union VAL Link Here
427
		return 1;
427
		return 1;
428
	case FILE_STRING:
428
	case FILE_STRING:
429
		{
429
		{
430
			int n;
430
			size_t n;
431
431
432
			/* Null terminate and eat *trailing* return */
432
			/* Null terminate and eat *trailing* return */
433
			p->s[sizeof(p->s) - 1] = '\0';
433
			p->s[sizeof(p->s) - 1] = '\0';
434
			n = strlen(p->s) - 1;
434
			n = strlen(p->s);
435
			if (p->s[n] == '\n')
435
			if (n-- && p->s[n] == '\n')
436
				p->s[n] = '\0';
436
				p->s[n] = '\0';
437
			return 1;
437
			return 1;
438
		}
438
		}

Return to bug 63576