summaryrefslogtreecommitdiff
path: root/xprop.c
diff options
context:
space:
mode:
authorJay Hobson <jay.hobson@sun.com>2001-08-08 13:38:33 -0700
committerAlan Coopersmith <alan.coopersmith@sun.com>2007-08-10 14:39:55 -0700
commit4f7bc8ecad63db6b7557b5556ac6f604e84eb55e (patch)
tree5168029f9884a20c291d45784bacd6812f4da9ad /xprop.c
parent23e375f3842b433b0af7f150135537f7381208ae (diff)
Sun Bug 4474581: xprop fails in Japanese locale
CJK locales need a much longer string as they include many \xXX entries which expand into /XXXXXXXX entries. Increased the buffer from 10000 to 500000 bytes. Make sure buffer pointer doesn't go negative in _put_char.
Diffstat (limited to 'xprop.c')
-rw-r--r--xprop.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/xprop.c b/xprop.c
index ab9b37e..c489486 100644
--- a/xprop.c
+++ b/xprop.c
@@ -55,7 +55,7 @@ from The Open Group.
#include "dsimple.h"
-#define MAXSTR 10000
+#define MAXSTR 500000
#define MAXELEMENTS 64
#ifndef min
@@ -671,11 +671,12 @@ static int _buf_len;
static void
_put_char (char c)
{
- if (--_buf_len < 0) {
+ if (_buf_len <= 0) {
_buf_ptr[0] = '\0';
return;
}
_buf_ptr++[0] = c;
+ _buf_len--;
}
static void