X-Git-Url: http://git.tuebingen.mpg.de/?p=paraslash.git;a=blobdiff_plain;f=color.c;h=0e2beeb0cac4f703668a666db4b57ab954c27c0e;hp=8be246d33eae9c09dace905b776b573a3e1bb654;hb=8aa0f575bcca12ab63ab53141c2144448c457478;hpb=62ed05732ec3669aae2ef4a544df216641cb4e3a diff --git a/color.c b/color.c index 8be246d3..0e2beeb0 100644 --- a/color.c +++ b/color.c @@ -47,11 +47,9 @@ static int parse_attr(const char *name, int len) * \param value Human-readable color spec. * \param dst Result pointer for the escape sequence. * - * \return -1 on errors, 1 on success. - * * Format of \a value: [fg [bg]] [attr]. */ -int color_parse(const char *value, char *dst) +void color_parse_or_die(const char *value, char *dst) { const char *ptr = value; int attr = -1; @@ -60,7 +58,7 @@ int color_parse(const char *value, char *dst) if (!strcasecmp(value, "reset")) { strcpy(dst, COLOR_RESET); - return 1; + return; } /* [fg [bg]] [attr] */ @@ -113,7 +111,7 @@ int color_parse(const char *value, char *dst) } } if (bg >= 0) { - if (sep++) + if (sep) *dst++ = ';'; if (bg < 8) { *dst++ = '4'; @@ -125,8 +123,8 @@ int color_parse(const char *value, char *dst) *dst++ = 'm'; } *dst = 0; - return 1; + return; bad: - PARA_ERROR_LOG("bad color value '%s'\n", value); - return -1; + PARA_EMERG_LOG("bad color value '%s'\n", value); + exit(EXIT_FAILURE); }