mirror of
git://sourceware.org/git/lvm2.git
synced 2024-12-21 13:34:40 +03:00
Use dm_snprintf to avoid duplicating the snprintf compatibility code.
This commit is contained in:
parent
24bf9537a7
commit
7b6c011c54
@ -1224,17 +1224,14 @@ static int _build_dev_string(char *devbuf, size_t bufsize, struct dm_tree_node *
|
||||
|
||||
/* simplify string emiting code */
|
||||
#define EMIT_PARAMS(p, str...)\
|
||||
do {\
|
||||
const size_t bufsize = paramsize - (size_t)p;\
|
||||
int w;\
|
||||
\
|
||||
if ((w = snprintf(params + p, bufsize, str)) < 0\
|
||||
|| ((size_t)w >= bufsize)) {\
|
||||
stack; /* Out of space */\
|
||||
return -1;\
|
||||
}\
|
||||
p += w;\
|
||||
} while (0)
|
||||
do {\
|
||||
int w;\
|
||||
if ((w = dm_snprintf(params + p, paramsize - (size_t) p, str)) < 0) {\
|
||||
stack; /* Out of space */\
|
||||
return -1;\
|
||||
}\
|
||||
p += w;\
|
||||
} while (0)
|
||||
|
||||
static int _emit_areas_line(struct dm_task *dmt __attribute((unused)),
|
||||
struct load_segment *seg, char *params,
|
||||
|
Loading…
Reference in New Issue
Block a user