From: Lennart Poettering Date: Thu, 14 Dec 2017 18:50:43 +0000 (+0100) Subject: link-config: make initialization to -1 less weird X-Git-Tag: v237~220^2~1 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=ab27086387c29886febd27e5366bc1b3eea2df06;p=platform%2Fupstream%2Fsystemd.git link-config: make initialization to -1 less weird memset() is weird anyway, since it expects an "int" as second parameter, which it then uses as a byte, i.e. as uint8_t or something like that. But by passing -1 to it, things get particularly weird, as that relies on sign expansion to do the right thing. --- diff --git a/src/udev/net/link-config.c b/src/udev/net/link-config.c index 89891f9..9fc9c11 100644 --- a/src/udev/net/link-config.c +++ b/src/udev/net/link-config.c @@ -171,7 +171,7 @@ static int load_link(link_config_ctx *ctx, const char *filename) { link->port = _NET_DEV_PORT_INVALID; link->autonegotiation = -1; - memset(&link->features, -1, sizeof(link->features)); + memset(&link->features, 0xFF, sizeof(link->features)); r = config_parse(NULL, filename, file, "Match\0Link\0Ethernet\0",