summaryrefslogtreecommitdiff
path: root/kicad/sch-parse.c
diff options
context:
space:
mode:
Diffstat (limited to 'kicad/sch-parse.c')
-rw-r--r--kicad/sch-parse.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/kicad/sch-parse.c b/kicad/sch-parse.c
index 3b7878f..3cdebb4 100644
--- a/kicad/sch-parse.c
+++ b/kicad/sch-parse.c
@@ -101,7 +101,7 @@ static bool parse_field(struct sch_ctx *ctx, const char *line)
struct text *txt;
char *s;
const char *p;
- int pos, len;
+ int pos = 0, len;
field = alloc_type(struct comp_field);
txt = &field->txt;
@@ -114,7 +114,7 @@ static bool parse_field(struct sch_ctx *ctx, const char *line)
return 1;
}
- if (sscanf(line, "F %d \"%n", &n, &pos) != 1)
+ if (sscanf(line, "F %d \"%n", &n, &pos) != 1 || !pos)
return 0;
for (p = line + pos; *p && *p != '"'; p++)
if (*p == '\\' && p[1])