From 1ef33ef64584a8b6e60a3b34d781bd1a1c06ad93 Mon Sep 17 00:00:00 2001 From: David Walter Seikel Date: Wed, 29 Jan 2014 22:06:08 +1000 Subject: Fix parsing the final CSI parameter. --- boxes.c | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/boxes.c b/boxes.c index 1c1409f..48b2697 100644 --- a/boxes.c +++ b/boxes.c @@ -2023,11 +2023,13 @@ TODO So abort the current CSI and start from scratch. // So we know when we get to the end of parameter space. t = rindex("01234567890:;<=>?", buffer[j + 1]); // See if we passed a paremeter. - if ((';' == buffer[j]) || (NULL == t)) + if ((';' == buffer[j]) || (!t)) { - buffer[j] = 0; + // Only stomp on the ; if it's really the ;. + if (t) + buffer[j] = 0; // Empty parameters are default parameters, so only deal with non defaults. - if (';' != buffer[csIndex] || (NULL == t)) + if (';' != buffer[csIndex] || (!t)) { // TODO - Might be ":" in the number somewhere, but we are not expecting any in anything we do. csParams[csCount] = atoi(&buffer[csIndex]); -- cgit v1.1