gzz-commits
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Gzz-commits] gzz/gfx/jni GzzGL-jni.cxx


From: Asko Soukka
Subject: Re: [Gzz-commits] gzz/gfx/jni GzzGL-jni.cxx
Date: Fri, 27 Sep 2002 13:31:28 +0300 (EEST)

> > > + /** Converts std::string to jstring through UTF-8 transformation */
> > > + jstring stdstr2jstr(JNIEnv *env, std::string stdstr) {
> > > +   return env->NewStringUTF(stdstr.data());
> > >   }
> > As I recall, std::string::data does not null-terminate its content.
> > How does NewStringUTF know the length of the data?
> I wonder the same thing. I think the call should be 
> NewStringUTF(stdstr.c_str()) instead. In the case of unistring, data() 

Right :) I remembered that c_str() was just an alias to data(). Now 
checked, and of course the end null makes difference. Quick fix.

-- 
Asko Soukka     | Taitoniekantie 9 A 603 | address@hidden
+358-40-8235947 | FIN-40740 JYVÄSKYLÄ    | http://www.iki.fi/asko.soukka/





reply via email to

[Prev in Thread] Current Thread [Next in Thread]