aboutsummaryrefslogtreecommitdiffstatshomepage
diff options
context:
space:
mode:
authorDavid Walter Seikel2014-01-29 22:06:08 +1000
committerDavid Walter Seikel2014-01-29 22:06:08 +1000
commit1ef33ef64584a8b6e60a3b34d781bd1a1c06ad93 (patch)
treec3f5ac1c57b6c1ee74b44208ca4af40d841ea36d
parentFix memory corruption. (diff)
downloadboxes-1ef33ef64584a8b6e60a3b34d781bd1a1c06ad93.zip
boxes-1ef33ef64584a8b6e60a3b34d781bd1a1c06ad93.tar.gz
boxes-1ef33ef64584a8b6e60a3b34d781bd1a1c06ad93.tar.bz2
boxes-1ef33ef64584a8b6e60a3b34d781bd1a1c06ad93.tar.xz
Fix parsing the final CSI parameter.
-rw-r--r--boxes.c8
1 files 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.
2023 // So we know when we get to the end of parameter space. 2023 // So we know when we get to the end of parameter space.
2024 t = rindex("01234567890:;<=>?", buffer[j + 1]); 2024 t = rindex("01234567890:;<=>?", buffer[j + 1]);
2025 // See if we passed a paremeter. 2025 // See if we passed a paremeter.
2026 if ((';' == buffer[j]) || (NULL == t)) 2026 if ((';' == buffer[j]) || (!t))
2027 { 2027 {
2028 buffer[j] = 0; 2028 // Only stomp on the ; if it's really the ;.
2029 if (t)
2030 buffer[j] = 0;
2029 // Empty parameters are default parameters, so only deal with non defaults. 2031 // Empty parameters are default parameters, so only deal with non defaults.
2030 if (';' != buffer[csIndex] || (NULL == t)) 2032 if (';' != buffer[csIndex] || (!t))
2031 { 2033 {
2032 // TODO - Might be ":" in the number somewhere, but we are not expecting any in anything we do. 2034 // TODO - Might be ":" in the number somewhere, but we are not expecting any in anything we do.
2033 csParams[csCount] = atoi(&buffer[csIndex]); 2035 csParams[csCount] = atoi(&buffer[csIndex]);