diff options
| author | Sebastiano Tronto <sebastiano@tronto.net> | 2026-09-17 21:20:22 +0200 |
|---|---|---|
| committer | Sebastiano Tronto <sebastiano@tronto.net> | 2026-09-17 21:22:36 +0200 |
| commit | 2f9d00075b0d236ecd8431761bb045e6aa088001 (patch) | |
| tree | 461444185e5d342725c60cff79d45bedc95a2c86 /src/solvers/coord | |
| parent | 654e6c34637c9ba344a3620014de22f8f3dfb4ca (diff) | |
| download | nissy-core-2f9d00075b0d236ecd8431761bb045e6aa088001.tar.gz nissy-core-2f9d00075b0d236ecd8431761bb045e6aa088001.zip | |
twostep solver (wip)
Diffstat (limited to 'src/solvers/coord')
| -rw-r--r-- | src/solvers/coord/gendata.h | 17 |
1 files changed, 13 insertions, 4 deletions
diff --git a/src/solvers/coord/gendata.h b/src/solvers/coord/gendata.h index edf6ce6..81ab842 100644 --- a/src/solvers/coord/gendata.h +++ b/src/solvers/coord/gendata.h | |||
| @@ -24,16 +24,25 @@ gendata_coord_dispatch( | |||
| 24 | unsigned char *buf | 24 | unsigned char *buf |
| 25 | ) | 25 | ) |
| 26 | { | 26 | { |
| 27 | size_t r; | ||
| 27 | coord_t *coord; | 28 | coord_t *coord; |
| 28 | multicoord_t *mcoord; | 29 | multicoord_t *mcoord; |
| 29 | 30 | ||
| 30 | parse_coord_and_trans(coordstr, &coord, &mcoord, NULL); | 31 | parse_coord_and_trans(coordstr, &coord, &mcoord, NULL); |
| 31 | 32 | ||
| 32 | if (coord != NULL) | 33 | if (coord != NULL) { |
| 33 | return gendata_coord(coord, buf); | 34 | if (bufsize < gendata_coord(coord, NULL)) |
| 35 | return NISSY_ERROR_BUFFER_SIZE; | ||
| 36 | r = gendata_coord(coord, buf); | ||
| 37 | return r == 0 ? NISSY_ERROR_UNKNOWN : (long long)r; | ||
| 38 | } | ||
| 34 | 39 | ||
| 35 | if (mcoord != NULL) | 40 | if (mcoord != NULL) { |
| 36 | return gendata_multicoord(mcoord, buf); | 41 | if (bufsize < gendata_multicoord(mcoord, NULL)) |
| 42 | return NISSY_ERROR_BUFFER_SIZE; | ||
| 43 | r = gendata_multicoord(mcoord, buf); | ||
| 44 | return r == 0 ? NISSY_ERROR_UNKNOWN : (long long)r; | ||
| 45 | } | ||
| 37 | 46 | ||
| 38 | LOG("Error: could not parse coordinate '%s'\n", coordstr); | 47 | LOG("Error: could not parse coordinate '%s'\n", coordstr); |
| 39 | return NISSY_ERROR_INVALID_SOLVER; | 48 | return NISSY_ERROR_INVALID_SOLVER; |
