diff options
author | Karel Kočí <cynerd@email.cz> | 2015-05-01 21:13:45 +0200 |
---|---|---|
committer | Karel Kočí <cynerd@email.cz> | 2015-05-01 21:13:45 +0200 |
commit | dffb32d33c06f8fae030c95daaca8aeffc5186fe (patch) | |
tree | 5303256141e92a8e568a74b4f7fe4ae7172355e0 /scripts/write_config | |
parent | 686f86bce10cbe5299bfb786bd955d9cd3f6e807 (diff) | |
download | linux-conf-perf-dffb32d33c06f8fae030c95daaca8aeffc5186fe.tar.gz linux-conf-perf-dffb32d33c06f8fae030c95daaca8aeffc5186fe.tar.bz2 linux-conf-perf-dffb32d33c06f8fae030c95daaca8aeffc5186fe.zip |
write_config update to parse_kconfig changes
Diffstat (limited to 'scripts/write_config')
-rw-r--r-- | scripts/write_config/solution.c | 4 | ||||
-rw-r--r-- | scripts/write_config/solution.h | 2 | ||||
-rw-r--r-- | scripts/write_config/symlist.c | 3 | ||||
-rw-r--r-- | scripts/write_config/symlist.h | 1 | ||||
-rw-r--r-- | scripts/write_config/write.c | 2 |
5 files changed, 9 insertions, 3 deletions
diff --git a/scripts/write_config/solution.c b/scripts/write_config/solution.c index 5a82a01..a8d9fc7 100644 --- a/scripts/write_config/solution.c +++ b/scripts/write_config/solution.c @@ -1,6 +1,6 @@ #include "solution.h" -void solution_set(struct symlist *sl, FILE * f) { +void solution_check(struct symlist *sl, FILE * f) { int c; // skip first line do @@ -22,6 +22,8 @@ void solution_set(struct symlist *sl, FILE * f) { ww = w + 1; } int id = atoi(ww); + if ((unsigned) id > sl->maxid) + break; if (id == 0) continue; if (sl->array[id - 1].sym == NULL) diff --git a/scripts/write_config/solution.h b/scripts/write_config/solution.h index fb1ebed..91db619 100644 --- a/scripts/write_config/solution.h +++ b/scripts/write_config/solution.h @@ -8,6 +8,6 @@ #ifndef _SOLUTION_H_ #define _SOLUTION_H_ -void solution_set(struct symlist *sl, FILE * f); +void solution_check(struct symlist *sl, FILE * f); #endif /* _SOLUTION_H_ */ diff --git a/scripts/write_config/symlist.c b/scripts/write_config/symlist.c index e0e7a1f..fd0aca8 100644 --- a/scripts/write_config/symlist.c +++ b/scripts/write_config/symlist.c @@ -6,6 +6,7 @@ struct symlist *symlist_read(FILE * f) { struct symlist *ret; ret = malloc(sizeof(struct symlist)); ret->size = 1; + ret->maxid = 0; ret->array = malloc(ret->size * sizeof(struct symlist_el)); unsigned int id; @@ -24,6 +25,8 @@ struct symlist *symlist_read(FILE * f) { realloc(ret->array, ret->size * sizeof(struct symlist_el)); } + if (id > ret->maxid) + ret->maxid = id; ret->array[(size_t) id - 1].id = id; if (!strncmp(w, NONAMEGEN, strlen(NONAMEGEN))) ret->array[(size_t) id - 1].sym = NULL; diff --git a/scripts/write_config/symlist.h b/scripts/write_config/symlist.h index 3736b2b..8bc61c1 100644 --- a/scripts/write_config/symlist.h +++ b/scripts/write_config/symlist.h @@ -15,6 +15,7 @@ struct symlist_el { struct symlist { struct symlist_el *array; size_t size; + unsigned maxid; }; struct symlist *symlist_read(FILE *f); diff --git a/scripts/write_config/write.c b/scripts/write_config/write.c index 4bec6aa..86895b6 100644 --- a/scripts/write_config/write.c +++ b/scripts/write_config/write.c @@ -63,7 +63,7 @@ int main(int argc, char **argv) { Eprintf("Can't open file: %s\n", solution_file); exit(2); } - solution_set(sl, f); + solution_check(sl, f); fclose(f); conf_write(".config"); |