spaces in the name. Fixed. (One day I really must get round to
turning this into a proper config mechanism.)
git-svn-id: svn://svn.tartarus.org/sgt/puzzles@6163
cda61777-01e9-0310-a592-
d414129be87e
for (i = 0; i < *ncolours; i++) {
char buf[80], *e;
unsigned int r, g, b;
for (i = 0; i < *ncolours; i++) {
char buf[80], *e;
unsigned int r, g, b;
sprintf(buf, "%s_COLOUR_%d", me->ourgame->name, i);
sprintf(buf, "%s_COLOUR_%d", me->ourgame->name, i);
- for (j = 0; buf[j]; j++)
- buf[j] = toupper((unsigned char)buf[j]);
+ for (j = k = 0; buf[j]; j++)
+ if (!isspace((unsigned char)buf[j]))
+ buf[k++] = toupper((unsigned char)buf[j]);
+ buf[k] = '\0';
if ((e = getenv(buf)) != NULL &&
sscanf(e, "%2x%2x%2x", &r, &g, &b) == 3) {
ret[i*3 + 0] = r / 255.0;
if ((e = getenv(buf)) != NULL &&
sscanf(e, "%2x%2x%2x", &r, &g, &b) == 3) {
ret[i*3 + 0] = r / 255.0;
* encoded parameter strings.
*/
char buf[80], *e, *p;
* encoded parameter strings.
*/
char buf[80], *e, *p;
sprintf(buf, "%s_PRESETS", me->ourgame->name);
sprintf(buf, "%s_PRESETS", me->ourgame->name);
- for (j = 0; buf[j]; j++)
- buf[j] = toupper((unsigned char)buf[j]);
+ for (j = k = 0; buf[j]; j++)
+ if (!isspace((unsigned char)buf[j]))
+ buf[k++] = toupper((unsigned char)buf[j]);
+ buf[k] = '\0';
if ((e = getenv(buf)) != NULL) {
p = e = dupstr(e);
if ((e = getenv(buf)) != NULL) {
p = e = dupstr(e);