Ooops :)  Missed that part.  You are (of course :) ) correct.  Must be 
something else corrupting the descriptor when calling iconv repeatedly.

Bruce Vining




Scott Klement <c400-l@xxxxxxxxxxxxxxxx> 
Sent by: c400-l-bounces+bvining=us.ibm.com@xxxxxxxxxxxx
04/07/2006 03:34 PM
Please respond to
C programming iSeries / AS400 <c400-l@xxxxxxxxxxxx>


To
C programming iSeries / AS400 <c400-l@xxxxxxxxxxxx>
cc

Subject
Re: [C400-L] problems with iconv_open







> The conversion descriptor is reuseable.  I would check to make sure you
> aren't inadvertently writing over it somewhere in your code (like you 
seem
> to be assuming your input will never exceed 32K but don't actually 
check).

Since outleft is set to the 32k size, iconv() won't convert past 32k 
anyway, will it?  So, unless I'm very confused, the program that I posted 
as a sample (which seems to be what you're referring to) won't ever 
overwrite memory that it shouldn't....

It's true that there might be input that doesn't get translated (if the 
parameter is longer than what will fit into the output buffer) but I don't 

see how it could overwrite another area of memory...


This thread ...

Replies:

Follow On AppleNews
Return to Archive home page | Return to MIDRANGE.COM home page

This mailing list archive is Copyright 1997-2019 by midrange.com and David Gibbs as a compilation work. Use of the archive is restricted to research of a business or technical nature. Any other uses are prohibited. Full details are available here. If you have questions about this, please contact [javascript protected email address].