]> sourceware.org Git - lvm2.git/commitdiff
Use dm_snprintf to avoid duplicating the snprintf compatibility code.
authorAlasdair Kergon <agk@redhat.com>
Fri, 12 Dec 2008 18:45:58 +0000 (18:45 +0000)
committerAlasdair Kergon <agk@redhat.com>
Fri, 12 Dec 2008 18:45:58 +0000 (18:45 +0000)
libdm/libdm-deptree.c

index d70e1b43a560182b110a2552a3fd21f9ad0125ce..11428ca7c89bff03f36643f20a6a1d71f36ea48a 100644 (file)
@@ -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,
This page took 0.041923 seconds and 5 git commands to generate.