From 4427d092ef92baa22b43e88c0ab6591b496c8c44 Mon Sep 17 00:00:00 2001 From: Werner Almesberger Date: Fri, 29 Jul 2016 22:17:06 -0300 Subject: [PATCH] sch2fig/Makefile (CFLAGS), sch.c: add -O; suppress asprintf warning --- sch2fig/Makefile | 2 +- sch2fig/sch.c | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/sch2fig/Makefile b/sch2fig/Makefile index d1411e2..6784e72 100644 --- a/sch2fig/Makefile +++ b/sch2fig/Makefile @@ -13,7 +13,7 @@ NAME = sch2fig OBJS = main.o sch.o lib.o fig.o dwg.o text.o misc.o -CFLAGS = -g -Wall -Wextra -Wno-unused-parameter -Wshadow +CFLAGS = -g -O -Wall -Wextra -Wno-unused-parameter -Wshadow LIBS = -lm include ../common/Makefile.c-common diff --git a/sch2fig/sch.c b/sch2fig/sch.c index bb3d33d..b8c4a70 100644 --- a/sch2fig/sch.c +++ b/sch2fig/sch.c @@ -362,7 +362,7 @@ static void do_hsheet_text(struct sch_ctx *ctx) .hor = text_min, .vert = text_min, }; - asprintf(&s, "Sheet: %s", ctx->sheet); + if (asprintf(&s, "Sheet: %s", ctx->sheet)) {} sheet_txt.s = s; /* work around "const" mismatch */ struct text file_txt = { @@ -373,7 +373,7 @@ static void do_hsheet_text(struct sch_ctx *ctx) .hor = text_min, .vert = text_max, }; - asprintf(&s, "File: %s", ctx->file); + if (asprintf(&s, "File: %s", ctx->file)) {} file_txt.s = s; /* work around "const" mismatch */ if (ctx->rotated) {