aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorgotmor <gotmor@f2baff5b-bf2c-0410-a398-912abdc3d8b2>2008-01-16 19:53:56 +0000
committergotmor <gotmor@f2baff5b-bf2c-0410-a398-912abdc3d8b2>2008-01-16 19:53:56 +0000
commit536bffd1aedf24105a4a120f72e2553b6a31592c (patch)
treefa747bdfc62ddb0484a177c74d2961d633e20210
parent6de4f5566f77ff41aa6ebdc0ba6ced0863e0fc24 (diff)
downloaddzen-536bffd1aedf24105a4a120f72e2553b6a31592c.tar.gz
dzen-536bffd1aedf24105a4a120f72e2553b6a31592c.zip
fixed bug in get_rect_vals()
git-svn-id: http://dzen.googlecode.com/svn/trunk@204 f2baff5b-bf2c-0410-a398-912abdc3d8b2
-rw-r--r--draw.c21
1 files changed, 11 insertions, 10 deletions
diff --git a/draw.c b/draw.c
index 01ced2d..251d187 100644
--- a/draw.c
+++ b/draw.c
@@ -215,29 +215,30 @@ setcolor(Drawable *pm, int x, int width, long tfg, long tbg, int reverse, int no
static void
get_rect_vals(char *s, int *w, int *h, int *x, int *y) {
int i, j;
- char buf[128];
+ char buf[ARGLEN];
*w=*h=*x=*y=0;
- for(i=0; s[i] && s[i] != 'x' && i<128; i++) {
+ for(i=0; s[i] && s[i] != 'x' && i<ARGLEN; i++) {
buf[i] = s[i];
}
buf[i] = '\0';
*w = atoi(buf);
- for(j=0, ++i; s[i] && s[i] != '+' && s[i] != '-' && j<128; j++, i++)
+ for(j=0, ++i; s[i] && s[i] != '+' && s[i] != '-' && i<ARGLEN; j++, i++)
buf[j] = s[i];
buf[j] = '\0';
*h = atoi(buf);
- for(j=0, ++i; s[i] && s[i] != '+' && s[i] != '-' && j<128; j++, i++)
- buf[j] = s[i];
- if(j<2) {
- buf[j] = '\0';
- *x = atoi(buf);
- *y = atoi(s+i);
+ if(s[i]) {
+ for(j=0, ++i; s[i] && s[i] != '+' && s[i] != '-' && i<ARGLEN; j++, i++)
+ buf[j] = s[i];
+ if(j<2) {
+ buf[j] = '\0';
+ *x = atoi(buf);
+ *y = atoi(s+i);
+ }
}
-
}
static int