<html><body style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space; ">From Expr.h:<div><br></div><div><div>/// StringLiteral - This represents a string literal expression, e.g. "foo"</div> <div>/// or L"bar" (wide strings).  The actual string is returned by getStrData()</div> <div>/// is NOT null-terminated, and the length of the string is determined by</div> <div>/// calling getByteLength().  The C type for a string is always a</div> <div>/// ConstantArrayType.</div><div><br></div><div>This means that using strlen(StringLiteral::getStrData()) is not safe; it will just march off the end of the literal until it hits the first null character that lies on the heap.</div><div><br><div><div>On Nov 11, 2008, at 6:02 PM, Zhongxing Xu wrote:</div><br class="Apple-interchange-newline"><blockquote type="cite">Did you use the fixed version? My observasion is that sometimes strlen(StringLiteral::getStrData()) is different from StringLiteral::getByteLength().<br><br><div class="gmail_quote">On Tue, Nov 11, 2008 at 11:47 PM, Nuno Lopes <span dir="ltr"><<a href="mailto:nunoplopes@sapo.pt">nunoplopes@sapo.pt</a>></span> wrote:<br><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;"> Here it works just fine. But my system's default charset is latin0 (similar with latin1).<br><font color="#888888"> Nuno</font><div><div></div><div class="Wj3C7c"><br> </div></div></blockquote></div><br> _______________________________________________<br>cfe-dev mailing list<br><a href="mailto:cfe-dev@cs.uiuc.edu">cfe-dev@cs.uiuc.edu</a><br>http://lists.cs.uiuc.edu/mailman/listinfo/cfe-dev<br></blockquote></div><br></div></div></body></html>