Be able to compile with -Wwrite-strings

This commit is contained in:
2018-07-12 15:58:29 +02:00
parent dff0a5c968
commit 96fe73a39f
4 changed files with 13 additions and 11 deletions

9
lib.c
View File

@@ -2550,8 +2550,8 @@ struct SyFmtInfo
sxu8 base; /* The base for radix conversion */
int flags; /* One or more of SXFLAG_ constants below */
sxu8 type; /* Conversion paradigm */
char *charset; /* The character set for conversion */
char *prefix; /* Prefix on non-zero values in alt format */
const char *charset; /* The character set for conversion */
const char *prefix; /* Prefix on non-zero values in alt format */
};
typedef struct SyFmtConsumer SyFmtConsumer;
struct SyFmtConsumer
@@ -2815,7 +2815,7 @@ static const SyFmtInfo aFmt[] = {
}
bufpt = &buf[SXFMT_BUFSIZ-1];
{
register char *cset; /* Use registers for speed */
register const char *cset; /* Use registers for speed */
register int base;
cset = infop->charset;
base = infop->base;
@@ -2830,7 +2830,8 @@ static const SyFmtInfo aFmt[] = {
}
if( prefix ) *(--bufpt) = prefix; /* Add sign */
if( flag_alternateform && infop->prefix ){ /* Add "0" or "0x" */
char *pre, x;
const char *pre;
char x;
pre = infop->prefix;
if( *bufpt!=pre[0] ){
for(pre=infop->prefix; (x=(*pre))!=0; pre++) *(--bufpt) = x;