diff options
author | Alan Coopersmith <alan.coopersmith@oracle.com> | 2013-06-22 10:56:53 -0700 |
---|---|---|
committer | Alan Coopersmith <alan.coopersmith@oracle.com> | 2013-06-22 10:56:53 -0700 |
commit | 230a1dc356266afb206c98e47ee72e8fca0948e2 (patch) | |
tree | 8fd810190073da5742ece3e6514889faec656fbd | |
parent | d8366afbb0d2e4fbb1e419b1187f490522270bea (diff) |
Replace sprintf with snprintf when looking up extension error strings
Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com>
-rw-r--r-- | include/X11/extensions/extutil.h | 2 | ||||
-rw-r--r-- | src/XSync.c | 2 |
2 files changed, 2 insertions, 2 deletions
diff --git a/include/X11/extensions/extutil.h b/include/X11/extensions/extutil.h index 29404d5..b228430 100644 --- a/include/X11/extensions/extutil.h +++ b/include/X11/extensions/extutil.h @@ -178,7 +178,7 @@ char *proc (Display *dpy, int code, XExtCodes *codes, char *buf, int n) \ code -= codes->first_error; \ if (code >= 0 && code < nerr) { \ char tmp[256]; \ - sprintf (tmp, "%s.%d", extname, code); \ + snprintf (tmp, sizeof(tmp), "%s.%d", extname, code); \ XGetErrorDatabaseText (dpy, "XProtoError", tmp, errl[code], buf, n); \ return buf; \ } \ diff --git a/src/XSync.c b/src/XSync.c index ce4ab44..6e2af79 100644 --- a/src/XSync.c +++ b/src/XSync.c @@ -189,7 +189,7 @@ char *error_string(Display *dpy, int code, XExtCodes *codes, char *buf, int n) code -= codes->first_error; if (code >= 0 && code < nerr) { char tmp[256]; - sprintf (tmp, "%s.%d", sync_extension_name, code); + snprintf (tmp, sizeof(tmp), "%s.%d", sync_extension_name, code); XGetErrorDatabaseText (dpy, "XProtoError", tmp, sync_error_list[code], buf, n); return buf; } |