[PATCH] strtol() fails on 32 bit systems when trying to parse a 32 bit 'string' fromt the config file, because it returns long which is signed. Use strtoll to solve the problem.

Scott Moreau oreaus at gmail.com
Fri Jan 27 07:53:57 PST 2012

I'm not sure this is the correct fix but if nothing else, this can serve as a bug report until the tracker is up. The problem is that config-parser sets variables to incorrect values on 32 bit systems which causes problems. Specifically, this fixes a bug where the background color value is wrong. Sometimes alpha is not 1 and it leaves ghost trails for any movement.
 shared/config-parser.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/shared/config-parser.c b/shared/config-parser.c
index 3b8c5c2..64b5151 100644
--- a/shared/config-parser.c
+++ b/shared/config-parser.c
@@ -35,7 +35,7 @@ handle_key(const struct config_key *key, const char *value)
 	switch (key->type) {
-		i = strtol(value, &end, 0);
+		i = strtoll(value, &end, 0);
 		if (*end != '\n') {
 			fprintf(stderr, "invalid integer: %s\n", value);
 			return -1;

More information about the wayland-devel mailing list