summaryrefslogtreecommitdiff
path: root/src/libsystemd-bus/bus-socket.c
diff options
context:
space:
mode:
authorCristian Rodríguez <crrodriguez@opensuse.org>2013-04-01 03:08:05 -0300
committerZbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl>2013-04-01 23:43:48 -0400
commit9607d9470eec07df817e58f64d312ccb5ac4cfcc (patch)
treed0d933b13ec47e4d22dcee3078af94e89a998e6e /src/libsystemd-bus/bus-socket.c
parente5ec62c56963d997edaffa904af5dc45dac23988 (diff)
Always use our own MAX/MIN definitions
code in src/shared/macro.h only defined MAX/MIN in case they were not defined previously. however the MAX/MIN macros implemented in glibc are not of the "safe" kind but defined as: define MIN(a,b) (((a)<(b))?(a):(b)) define MAX(a,b) (((a)>(b))?(a):(b)) Avoid nasty side effects by using our own versions instead. Also fix the warnings derived from this change. [zj: - modify MAX3 macro to fix warning about _a shadowing _a, - do bootchart/svg.c too, - remove unused MIN3.]
Diffstat (limited to 'src/libsystemd-bus/bus-socket.c')
-rw-r--r--src/libsystemd-bus/bus-socket.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/libsystemd-bus/bus-socket.c b/src/libsystemd-bus/bus-socket.c
index 5b5a731233..c68c7bca68 100644
--- a/src/libsystemd-bus/bus-socket.c
+++ b/src/libsystemd-bus/bus-socket.c
@@ -455,7 +455,7 @@ static int bus_socket_read_auth(sd_bus *b) {
if (r != 0)
return r;
- n = MAX(256, b->rbuffer_size * 2);
+ n = MAX(256u, b->rbuffer_size * 2);
if (n > BUS_AUTH_SIZE_MAX)
n = BUS_AUTH_SIZE_MAX;