On Jun 2, 2014 10:16 AM, "Jun T." wrote: > > Is it possible for iconv() to return >=0 while orig_name_len != 0 ? > man iconv(3) mentions four possible cases, > three of them are error (return value is -1), > and the remaining one is (returnvalue>=0 and orig_name_len==0). I'm not sure how it maps onto the described return cases, but I encountered a case in testing where iconv returned zero and orig_name_len was unchanged, i.e., nothing was copied to conv_name_ptr. Without the extra test this results in empty string as the output filename.