summaryrefslogtreecommitdiff
path: root/kicad/sch-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/sch-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/sch-render.c')
-rw-r--r--kicad/sch-render.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/kicad/sch-render.c b/kicad/sch-render.c
index 5d3c9e0..52be40f 100644
--- a/kicad/sch-render.c
+++ b/kicad/sch-render.c
@@ -11,10 +11,10 @@
*/
-#define _GNU_SOURCE /* for asprintf */
#include <stdio.h>
#include <assert.h>
+#include "misc/util.h"
#include "misc/diag.h"
#include "gfx/misc.h"
#include "gfx/style.h"
@@ -82,7 +82,7 @@ static void do_hsheet_text(const struct sch_obj *obj,
.vert = text_min,
.style = text_normal,
};
- if (asprintf(&s, "Sheet: %s", sheet->name)) {}
+ alloc_printf(&s, "Sheet: %s", sheet->name);
sheet_txt.s = s; /* work around "const" mismatch */
struct text file_txt = {
@@ -94,7 +94,7 @@ static void do_hsheet_text(const struct sch_obj *obj,
.vert = text_max,
.style = text_normal,
};
- if (asprintf(&s, "File: %s", sheet->file)) {}
+ alloc_printf(&s, "File: %s", sheet->file);
file_txt.s = s; /* work around "const" mismatch */
if (sheet->rotated) {