summaryrefslogtreecommitdiff
path: root/kicad/pl-render.c
diff options
context:
space:
mode:
authorWerner Almesberger <werner@almesberger.net>2016-08-30 06:49:49 -0300
committerWerner Almesberger <werner@almesberger.net>2016-08-30 06:49:49 -0300
commit9a0fe02922549d804ba0e4a9c8535ce25f7930d9 (patch)
tree44caf72d27bd070597a7a846fbb9f44f40a92568 /kicad/pl-render.c
parentfe2d12a590aa637881c7f3fc53d3cca9e246c195 (diff)
downloadeeshow-9a0fe02922549d804ba0e4a9c8535ce25f7930d9.tar.gz
eeshow-9a0fe02922549d804ba0e4a9c8535ce25f7930d9.tar.bz2
eeshow-9a0fe02922549d804ba0e4a9c8535ce25f7930d9.zip
misc/util.h (alloc_printf): error-checking vasprintf wrapper; use it
Diffstat (limited to 'kicad/pl-render.c')
-rw-r--r--kicad/pl-render.c5
1 files changed, 2 insertions, 3 deletions
diff --git a/kicad/pl-render.c b/kicad/pl-render.c
index 914eee7..c56519c 100644
--- a/kicad/pl-render.c
+++ b/kicad/pl-render.c
@@ -10,7 +10,6 @@
* (at your option) any later version.
*/
-#define _GNU_SOURCE /* for asprintf */
#include <stdbool.h>
#include <stdlib.h>
#include <stdio.h>
@@ -88,7 +87,7 @@ static char *expand(const struct pl_ctx *pl, const char *s,
n = 0;
for (sch = sheets; sch; sch = sch->next)
n++;
- if (asprintf(&x, "%u", n)) {}
+ alloc_printf(&x, "%u", n);
break;
case 'P':
x = "%P"; // sheet path
@@ -101,7 +100,7 @@ static char *expand(const struct pl_ctx *pl, const char *s,
for (sch = sheets; sch != sheet;
sch = sch->next)
n++;
- if (asprintf(&x, "%u", n)) {}
+ alloc_printf(&x, "%u", n);
break;
case 'T':
x = (char *) sheet->title;