[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.
Kristian Høgsberg
krh at bitplanet.net
Fri Jan 27 08:27:48 PST 2012
On Fri, Jan 27, 2012 at 10:53 AM, Scott Moreau <oreaus at gmail.com> wrote:
> ---
> 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.
Ah, yes. A better fix would be to add a CONFIG_KEY_UNSIGNED_INTEGER
type and handle the conversion with strtoul instead.
Kristian
> 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) {
> case CONFIG_KEY_INTEGER:
> - i = strtol(value, &end, 0);
> + i = strtoll(value, &end, 0);
> if (*end != '\n') {
> fprintf(stderr, "invalid integer: %s\n", value);
> return -1;
> --
> 1.7.4.1
>
> _______________________________________________
> wayland-devel mailing list
> wayland-devel at lists.freedesktop.org
> http://lists.freedesktop.org/mailman/listinfo/wayland-devel
More information about the wayland-devel
mailing list