1
0
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:
Alasdair Kergon 2008-12-12 18:45:58 +00:00
parent 24bf9537a7
commit 7b6c011c54

View File

@ -1224,17 +1224,14 @@ static int _build_dev_string(char *devbuf, size_t bufsize, struct dm_tree_node *
/* simplify string emiting code */ /* simplify string emiting code */
#define EMIT_PARAMS(p, str...)\ #define EMIT_PARAMS(p, str...)\
do {\ do {\
const size_t bufsize = paramsize - (size_t)p;\ int w;\
int w;\ if ((w = dm_snprintf(params + p, paramsize - (size_t) p, str)) < 0) {\
\ stack; /* Out of space */\
if ((w = snprintf(params + p, bufsize, str)) < 0\ return -1;\
|| ((size_t)w >= bufsize)) {\ }\
stack; /* Out of space */\ p += w;\
return -1;\ } while (0)
}\
p += w;\
} while (0)
static int _emit_areas_line(struct dm_task *dmt __attribute((unused)), static int _emit_areas_line(struct dm_task *dmt __attribute((unused)),
struct load_segment *seg, char *params, struct load_segment *seg, char *params,