mirror of
https://github.com/curl/curl.git
synced 2026-07-31 08:38:06 +03:00
misc: fix "warning: empty expression statement has no effect"
Turned several macros into do-while(0) style to allow their use to work find with semicolon. Bug:08e8455ddd (commitcomment-45433279)Follow-up to08e8455dddReported-by: Gisle Vanem Closes #6376
This commit is contained in:
parent
ec424f311a
commit
8ab78f720a
11 changed files with 84 additions and 69 deletions
14
lib/urlapi.c
14
lib/urlapi.c
|
|
@ -983,12 +983,14 @@ void curl_url_cleanup(CURLU *u)
|
|||
}
|
||||
}
|
||||
|
||||
#define DUP(dest, src, name) \
|
||||
if(src->name) { \
|
||||
dest->name = strdup(src->name); \
|
||||
if(!dest->name) \
|
||||
goto fail; \
|
||||
}
|
||||
#define DUP(dest, src, name) \
|
||||
do { \
|
||||
if(src->name) { \
|
||||
dest->name = strdup(src->name); \
|
||||
if(!dest->name) \
|
||||
goto fail; \
|
||||
} \
|
||||
} while(0)
|
||||
|
||||
CURLU *curl_url_dup(CURLU *in)
|
||||
{
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue