aboutsummaryrefslogtreecommitdiff
path: root/xorg-server/hw/xfree86/parser/Flags.c
diff options
context:
space:
mode:
authormarha <marha@users.sourceforge.net>2010-12-12 20:34:06 +0000
committermarha <marha@users.sourceforge.net>2010-12-12 20:34:06 +0000
commitd3ae6e21a12209f5c8cb8c84ba0f68fb69736844 (patch)
tree62710b8524ebc7675ebd7f4976fd7f9530ce5df2 /xorg-server/hw/xfree86/parser/Flags.c
parent0be679f7724e33c2761ebb67846707fb3351167b (diff)
parent3a20d23b48c1051e1f22295fd886cc7f643417f6 (diff)
downloadvcxsrv-d3ae6e21a12209f5c8cb8c84ba0f68fb69736844.tar.gz
vcxsrv-d3ae6e21a12209f5c8cb8c84ba0f68fb69736844.tar.bz2
vcxsrv-d3ae6e21a12209f5c8cb8c84ba0f68fb69736844.zip
svn merge ^/branches/released .
Diffstat (limited to 'xorg-server/hw/xfree86/parser/Flags.c')
-rw-r--r--xorg-server/hw/xfree86/parser/Flags.c13
1 files changed, 4 insertions, 9 deletions
diff --git a/xorg-server/hw/xfree86/parser/Flags.c b/xorg-server/hw/xfree86/parser/Flags.c
index cdd023222..17e079a8c 100644
--- a/xorg-server/hw/xfree86/parser/Flags.c
+++ b/xorg-server/hw/xfree86/parser/Flags.c
@@ -61,8 +61,8 @@
#include "xf86Parser.h"
#include "xf86tokens.h"
#include "Configint.h"
-#include <math.h>
#include <X11/Xfuncproto.h>
+#include "Xprintf.h"
extern LexRec val;
@@ -143,9 +143,8 @@ xf86parseFlagsSection (void)
} else {
if (tokentype != NUMBER)
Error (NUMBER_MSG, tmp);
- valstr = malloc(16);
- if (valstr)
- sprintf(valstr, "%d", val.num);
+ if (asprintf(&valstr, "%d", val.num) == -1)
+ valstr = NULL;
}
}
ptr->flg_option_lst = xf86addNewOption
@@ -426,13 +425,9 @@ char *
xf86uLongToString(unsigned long i)
{
char *s;
- int l;
- l = ceil(log10((double)i) + 2.5);
- s = malloc(l);
- if (!s)
+ if (asprintf(&s, "%lu", i) == -1)
return NULL;
- sprintf(s, "%lu", i);
return s;
}