summaryrefslogtreecommitdiff
path: root/kicad
diff options
context:
space:
mode:
authorWerner Almesberger <werner@almesberger.net>2016-09-03 03:20:59 (GMT)
committerWerner Almesberger <werner@almesberger.net>2016-09-03 22:18:28 (GMT)
commitf5df2c93edaf61f67c55c46b614b1ba80b5c5bec (patch)
tree9192ab0e06695ca607c2a2a308e236f0c8776687 /kicad
parent88f37cefd07b8c5bb5f9251a704807540f4c233d (diff)
downloadeeshow-f5df2c93edaf61f67c55c46b614b1ba80b5c5bec.zip
eeshow-f5df2c93edaf61f67c55c46b614b1ba80b5c5bec.tar.gz
eeshow-f5df2c93edaf61f67c55c46b614b1ba80b5c5bec.tar.bz2
kicad/sch-parse.c (parse_field): make italic and bold optional, compatibility
Diffstat (limited to 'kicad')
-rw-r--r--kicad/sch-parse.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/kicad/sch-parse.c b/kicad/sch-parse.c
index 4f5b26d..d2cc72c 100644
--- a/kicad/sch-parse.c
+++ b/kicad/sch-parse.c
@@ -137,7 +137,7 @@ static bool parse_field(struct sch_ctx *ctx, const char *line)
struct sch_comp *comp = &ctx->obj.u.comp;
int n;
unsigned flags;
- char hv, hor, vert, italic, bold;
+ char hv, hor, vert, italic = 'N', bold = 'N';
struct comp_field *field;
struct text *txt;
char *s;
@@ -151,7 +151,7 @@ static bool parse_field(struct sch_ctx *ctx, const char *line)
/* ignore fields with empty string as content */
if (sscanf(line, "F %d \"\" %c %d %d %u %u %c %c%c%c",
&n, &hv, &txt->x, &txt->y, &txt->size, &flags, &hor, &vert,
- &italic, &bold) == 10) {
+ &italic, &bold) >= 8) {
free(field);
return 1;
}
@@ -175,7 +175,7 @@ static bool parse_field(struct sch_ctx *ctx, const char *line)
if (sscanf(p + 1, " %c %d %d %u %u %c %c%c%c",
&hv, &txt->x, &txt->y, &txt->size, &flags,
- &hor, &vert, &italic, &bold) != 9) {
+ &hor, &vert, &italic, &bold) < 7) {
free(s);
free(field);
return 0;