[PATCH] _SPrint: fix NULL termination

maxlen is the maximum string length not the buffer size.

Signed-off-by: Jeremy Compostella <jeremy.compostella@intel.com>
Signed-off-by: Nigel Croxon <nigel.croxon@hp.com>
This commit is contained in:
Nigel Croxon 2015-03-23 10:41:43 -04:00
parent ce7098fb52
commit dada63fd3d
1 changed files with 1 additions and 1 deletions

View File

@ -345,7 +345,7 @@ _SPrint (
if (spc->len < spc->maxlen) {
spc->str[spc->len] = 0;
} else if (spc->maxlen) {
spc->str[spc->maxlen-1] = 0;
spc->str[spc->maxlen] = 0;
}
return 0;