X-Git-Url: https://jxself.org/git/?a=blobdiff_plain;f=config%2Flkc.h;h=7aa9db0b2a7776513bfb7ad7f9a79d567509861a;hb=5bc1c99e1bbdea2d94147d4c6480ef79652f2851;hp=b633bdb9f3d47c815be8727b155471167135626a;hpb=d1dbdf395b7ee5330b22008ba7c2cc704e157229;p=carl9170fw.git diff --git a/config/lkc.h b/config/lkc.h index b633bdb..7aa9db0 100644 --- a/config/lkc.h +++ b/config/lkc.h @@ -39,6 +39,12 @@ extern "C" { #ifndef CONFIG_ #define CONFIG_ "CONFIG_" #endif +static inline const char *CONFIG_prefix(void) +{ + return CONFIG_; +} +#undef CONFIG_ +#define CONFIG_ CONFIG_prefix() #define TF_COMMAND 0x0001 #define TF_PARAM 0x0002 @@ -90,8 +96,10 @@ struct conf_printer { /* confdata.c and expr.c */ static inline void xfwrite(const void *str, size_t len, size_t count, FILE *out) { - if (fwrite(str, len, count, out) < count) - fprintf(stderr, "\nError in writing or end of file.\n"); + assert(len != 0); + + if (fwrite(str, len, count, out) != count) + fprintf(stderr, "Error in writing or end of file.\n"); } /* menu.c */