chiark
/
gitweb
/
~mdw
/
mLib
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
@@@ tty mess
[mLib]
/
codec
/
baseconv.c
diff --git
a/codec/baseconv.c
b/codec/baseconv.c
index b7cb0a0618ebe0a893c2721c336429a9eb8cdb88..53949bb8ddb0f2c492828d245a30cb7f1c9e749b 100644
(file)
--- a/
codec/baseconv.c
+++ b/
codec/baseconv.c
@@
-28,8
+28,6
@@
/*----- Header files ------------------------------------------------------*/
#include <ctype.h>
/*----- Header files ------------------------------------------------------*/
#include <ctype.h>
-#include <stdio.h>
-#include <stdlib.h>
#include <string.h>
#include "alloc.h"
#include <string.h>
#include "alloc.h"
@@
-364,8
+362,8
@@
static int ctxn##_dodecode(ctxn##_ctx *ctx, \
case PC: \
if (f & CDCF_IGNEQMID) break; \
if (f & CDCF_NOEQPAD) goto badch; \
case PC: \
if (f & CDCF_IGNEQMID) break; \
if (f & CDCF_NOEQPAD) goto badch; \
- if (st == ST_MAIN &&
\
-
!(f & CDCF_IGNZPAD) && (a & ((1 << nb) - 1)))
\
+ if (st == ST_MAIN &&
!(f & CDCF_IGNZPAD) &&
\
+
((nb && !(nb%wd)) || (a & ((1 << nb) - 1))))
\
return (CDCERR_INVZPAD); \
st = ST_PAD; \
if (!(f & CDCF_IGNEQPAD)) { \
return (CDCERR_INVZPAD); \
st = ST_PAD; \
if (!(f & CDCF_IGNEQPAD)) { \
@@
-387,8
+385,8
@@
static int ctxn##_dodecode(ctxn##_ctx *ctx, \
} \
} \
} else { \
} \
} \
} else { \
- if (st == ST_MAIN &&
\
-
!(f & CDCF_IGNZPAD) && (a & ((1 << nb) - 1)))
\
+ if (st == ST_MAIN &&
!(f & CDCF_IGNZPAD) &&
\
+
((nb && !(nb%wd)) || (a & ((1 << nb) - 1))))
\
return (CDCERR_INVZPAD); \
if (!(f & (CDCF_IGNEQPAD | CDCF_IGNEQMID | CDCF_NOEQPAD)) && nb) \
return (CDCERR_INVEQPAD); \
return (CDCERR_INVZPAD); \
if (!(f & (CDCF_IGNEQPAD | CDCF_IGNEQMID | CDCF_NOEQPAD)) && nb) \
return (CDCERR_INVEQPAD); \
@@
-419,7
+417,7
@@
static int ctxn##_dec(codec *c, const void *p, size_t sz, dstr *d) \
static void ctxn##_destroy(codec *c) \
{ \
ctxn##_codec *bc = (ctxn##_codec *)c; \
static void ctxn##_destroy(codec *c) \
{ \
ctxn##_codec *bc = (ctxn##_codec *)c; \
- if (bc->ctx.indent) xfree(
(/*unconst*/ char *)bc->ctx.indent);
\
+ if (bc->ctx.indent) xfree(
UNCONST(char, bc->ctx.indent));
\
DESTROY(bc); \
} \
\
DESTROY(bc); \
} \
\