ViewVC Help
View File | Revision Log | Show Annotations | Download File
/cvs/JSON-XS/XS.xs
(Generate patch)

Comparing JSON-XS/XS.xs (file contents):
Revision 1.26 by root, Fri Apr 6 21:17:09 2007 UTC vs.
Revision 1.27 by root, Mon Apr 9 05:09:57 2007 UTC

109 if (enc->cur + len >= enc->end) 109 if (enc->cur + len >= enc->end)
110 { 110 {
111 STRLEN cur = enc->cur - SvPVX (enc->sv); 111 STRLEN cur = enc->cur - SvPVX (enc->sv);
112 SvGROW (enc->sv, cur + len + 1); 112 SvGROW (enc->sv, cur + len + 1);
113 enc->cur = SvPVX (enc->sv) + cur; 113 enc->cur = SvPVX (enc->sv) + cur;
114 enc->end = SvPVX (enc->sv) + SvLEN (enc->sv); 114 enc->end = SvPVX (enc->sv) + SvLEN (enc->sv) - 1;
115 } 115 }
116} 116}
117 117
118static void 118static void
119encode_ch (enc_t *enc, char ch) 119encode_ch (enc_t *enc, char ch)
519 519
520 if (!(flags & (F_ASCII | F_UTF8))) 520 if (!(flags & (F_ASCII | F_UTF8)))
521 SvUTF8_on (enc.sv); 521 SvUTF8_on (enc.sv);
522 522
523 SvCUR_set (enc.sv, enc.cur - SvPVX (enc.sv)); 523 SvCUR_set (enc.sv, enc.cur - SvPVX (enc.sv));
524 *SvEND (enc.sv) = 0; // many xs functions expect a trailing 0 for text strings
524 525
525 if (enc.flags & F_SHRINK) 526 if (enc.flags & F_SHRINK)
526 shrink (enc.sv); 527 shrink (enc.sv);
527 528
528 return enc.sv; 529 return enc.sv;

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines