We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
2 parents 7a2941f + cd64e7b commit 246f8b7Copy full SHA for 246f8b7
1 file changed
Token.xs
@@ -115,14 +115,15 @@ get(ctx)
115
size_t i, curr;
116
117
output = newSVpvn("", 0);
118
- SvGROW(output, ctx->token_length);
+ SvGROW(output, ctx->token_length + 1);
119
SvCUR_set(output, ctx->token_length);
120
- outputp = SvPV(output, ctx->token_length);
+ outputp = SvPV_nolen(output);
121
122
for (i=0; i<ctx->token_length; i++) {
123
while((curr = (get_new_byte(ctx) & ctx->mask)) >= ctx->alphabet_length) ;
124
outputp[i] = ctx->alphabet[curr];
125
}
126
+ outputp[i] = '\0';
127
128
RETVAL = output;
129
0 commit comments