summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAlan Coopersmith <alan.coopersmith@oracle.com>2011-02-13 10:23:43 -0800
committerAlan Coopersmith <alan.coopersmith@oracle.com>2011-02-13 10:42:25 -0800
commit07c1f9c135039606c63b88d51b93532199897ceb (patch)
tree94e47ac4e8819a0b3ec34b4448fc6560c0be9201
parentba4f4e7604afc23431c62c3886ab9419d5913661 (diff)
Off-by-one error on the other end of FSGetErrorText bounds check
The Font Server protocol actually defines 0 as an error code too. Before this fix, test/FSGetErrorText printed: FSGetErrorText for code FSBadRequest (0) returned: || Afterwards: FSGetErrorText for code FSBadRequest (0) returned: |BadRequest, invalid request code or no such operation| Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com>
-rw-r--r--src/FSErrDis.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/FSErrDis.c b/src/FSErrDis.c
index 5e9d9d2..5c1188f 100644
--- a/src/FSErrDis.c
+++ b/src/FSErrDis.c
@@ -104,7 +104,7 @@ int FSGetErrorText(
if (nbytes == 0)
return 0;
snprintf(buf, sizeof(buf), "%d", code);
- if (code < (FSErrorListSize / sizeof(char *)) && code > 0) {
+ if (code < (FSErrorListSize / sizeof(char *)) && code >= 0) {
defaultp = FSErrorList[code];
FSGetErrorDatabaseText(svr, "FSProtoError", buf, defaultp, buffer, nbytes);
}