summaryrefslogtreecommitdiff
path: root/kicad/sch-parse.c
diff options
context:
space:
mode:
authorWerner Almesberger <werner@almesberger.net>2017-04-04 04:51:39 (GMT)
committerWerner Almesberger <werner@almesberger.net>2017-04-04 04:51:39 (GMT)
commit5cdc19d9d33407f320a7a743ce3715fde1cd43f2 (patch)
tree2ca3b52f2a89eac4890f8837a11d32c6c64c3044 /kicad/sch-parse.c
parent38e063f08e6f6b054a2a6d94286df14ab7b7dc0b (diff)
downloadeeshow-5cdc19d9d33407f320a7a743ce3715fde1cd43f2.zip
eeshow-5cdc19d9d33407f320a7a743ce3715fde1cd43f2.tar.gz
eeshow-5cdc19d9d33407f320a7a743ce3715fde1cd43f2.tar.bz2
kicad/sch-parse.c (parse_line): CommentN is one-based, not zero-based
Diffstat (limited to 'kicad/sch-parse.c')
-rw-r--r--kicad/sch-parse.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/kicad/sch-parse.c b/kicad/sch-parse.c
index 5caed69..bb56620 100644
--- a/kicad/sch-parse.c
+++ b/kicad/sch-parse.c
@@ -1,8 +1,8 @@
/*
* kicad/sch-parse.c - Parse Eeschema .sch file
*
- * Written 2016 by Werner Almesberger
- * Copyright 2016 by Werner Almesberger
+ * Written 2016-2017 by Werner Almesberger
+ * Copyright 2016-2017 by Werner Almesberger
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
@@ -615,10 +615,10 @@ static bool parse_line(const struct file *file, void *user, const char *line)
&ctx->curr_sheet->comp) == 1)
return 1;
if (sscanf(line, "Comment%d \"%m[^\"]\"", &i, &s) == 2) {
- if (i < 0)
+ if (i <= 0)
fatal("%s:%u: invalid comment index %d",
file->name, file->lineno, i);
- add_comment(ctx->curr_sheet, i, s);
+ add_comment(ctx->curr_sheet, i - 1, s);
return 1;
}