> Le 9 juin 2017 à 21:38, Wenbo Zhao <[email protected]> a écrit :
> 
> David Raymond <[email protected] 
> <mailto:[email protected]>>于2017年6月10日 周六05:55写道:
> 
>> Non C programmer question: In your patch there, does sout have to be freed
>> or anything, or am I missing something?
> 
> No. The 4th arg of WriteConsoleW is lpNumberOfCharsWritten.

Sorry for the other (empty) post: mistakenly hit send early. :(

Indeed, as Wenbo points out, that parameter is the address of an unsigned 32 
bits integer which receives the count of 'characters' (count of 16 bits 
quantities) that were actually written. Nothing to be freed.

As I said, I hope clearly, in my original post: this patch is a quick-n-dirty 
patch just to show off some path.  Please do not use as such, except for 
experiment. Calling GetStdHandle() right there is not a good idea, it should be 
done once per shell run. Calling wcslen() to get the count of WCHARs is not 
appropriate too. Would I rewrite that, I'd probably rework 
sqlite3_win32_utf8_to_unicode() (introduce a different version, albeit maybe 
not yet another public sqlite3 API but a local version to the shell) in order 
to get back the count of WCHARs of the conversion result and reuse it (because 
that length is anyway a by-product of the conversion function itself).

All of this was just quickly draft to get it simple to see the difference. 
That's in no way close to production quality code for Sqlite coding standards.

-- 
Best Regards, Meilleures salutations, Met vriendelijke groeten,
Olivier Mascia, http://integral.software



_______________________________________________
sqlite-users mailing list
[email protected]
http://mailinglists.sqlite.org/cgi-bin/mailman/listinfo/sqlite-users

Reply via email to