]> git.ipfire.org Git - thirdparty/haproxy.git/commit
[CLEANUP] remove a warning from gcc due to htons() in standard.c
authorWilly Tarreau <w@1wt.eu>
Sun, 2 Dec 2007 09:55:56 +0000 (10:55 +0100)
committerWilly Tarreau <w@1wt.eu>
Sun, 2 Dec 2007 09:55:56 +0000 (10:55 +0100)
commitd1cd2764563dabb1e71cfce88b553f79fd16e76d
treed723ce9403154edd2ecd796c3bb021f9f28bb5df
parentb80c230f41880b636c384ad24c102a4cd01301cf
[CLEANUP] remove a warning from gcc due to htons() in standard.c

Due to the fact that htons is defined as a macro, it's dangerous
to call it with auto-incremented arguments such as htons(f(++x)) :

src/standard.c: In function 'url2sa':
src/standard.c:291: warning: operation on 'curr' may be undefined

The solution is simply to store the intermediate result an pass it
to htons() at once.
src/standard.c