File tree Expand file tree Collapse file tree 1 file changed +6
-6
lines changed Expand file tree Collapse file tree 1 file changed +6
-6
lines changed Original file line number Diff line number Diff line change @@ -687,17 +687,17 @@ fn transStringLiteral(
687
687
const kind = ZigClangStringLiteral_getKind (stmt );
688
688
switch (kind ) {
689
689
.Ascii , .UTF8 = > {
690
- var clen : usize = undefined ;
691
- const cstr = ZigClangStringLiteral_getString_bytes_begin_size (stmt , & clen );
692
- const zstr = try rp . c . str ( cstr ) ;
690
+ var len : usize = undefined ;
691
+ const bytes_ptr = ZigClangStringLiteral_getString_bytes_begin_size (stmt , & len );
692
+ const str = bytes_ptr [0 .. len ] ;
693
693
694
- var len : usize = 0 ;
695
- for (zstr ) | c | len += escapeChar (c ).len ;
694
+ len = 0 ;
695
+ for (str ) | c | len += escapeChar (c ).len ;
696
696
697
697
const buf = try rp .c .a ().alloc (u8 , len + "c\"\" " .len );
698
698
buf [0 ] = 'c' ;
699
699
buf [1 ] = '"' ;
700
- writeEscapedString (buf [2.. ], zstr );
700
+ writeEscapedString (buf [2.. ], str );
701
701
buf [buf .len - 1 ] = '"' ;
702
702
703
703
const token = try appendToken (rp .c , .StringLiteral , buf );
You can’t perform that action at this time.
0 commit comments