|
From: aruperez <arm...@gm...> - 2008-08-19 22:51:00
|
Christoph Bartoschek-2 wrote: > > > Your example code looks ok. Show us the real code. > > Christoph > > > ------------------------------------------------------------------------- > This SF.Net email is sponsored by the Moblin Your Move Developer's > challenge > Build the coolest Linux based applications with Moblin SDK & win great > prizes > Grand prize is a trip for two to an Open Source event anywhere in the > world > http://moblin-contest.org/redirect.php?banner_id=100&url=/ > _______________________________________________ > Valgrind-users mailing list > Val...@li... > https://lists.sourceforge.net/lists/listinfo/valgrind-users > > Well is very much the same but here it is string packSerial(int denomNumber, int cluster, int lot, int sublot, int serial){ char ser[11]; string container; string lotN = string(); sprintf(ser,"%d",denomNumber); container = string(ser); lotN.append(container.c_str()); sprintf(ser,"%d",cluster); container = string(ser); while(container.length()<3){ container = string('0'+container); } lotN.append(container.c_str()); sprintf(ser,"%d",lot); container = string(ser); while(container.length()<5){ container = string('0'+container); } for every one of the sprintf calls valgrind says Conditional jump or move depends on uninitialised value(s) ==28593== at 0x43820E5: vfprintf (in /lib/libc-2.6.1.so) ==28593== by 0x439E91B: vsprintf (in /lib/libc-2.6.1.so) ==28593== by 0x438A42D: sprintf (in /lib/libc-2.6.1.so) ==28593== by 0x806D42E: card_manager::packSerial(int, int, int, int, int) (card_manager.cpp:431) ==28593== by 0x807396B: card_manager::gen_keys(int, int, int, int, std::string) (card_manager.cpp:280) ==28593== by 0x8076BE2: command_interpreter::interpret(iso8583_frame const&) (command_interpreter.cpp:126) ==28593== by 0x8078642: request_handler::con_handling(request) (request_handler.cpp:55) ==28593== by 0x80787AE: request_handler::handle(request) (request_handler.cpp:25) ==28593== by 0x807888F: queue_process::consume(void*) (queue_process.cpp:69) ==28593== by 0x805CBAF: Consume(void*) (queue_process.cpp:78) ==28593== by 0x41CA191: start_thread (in /lib/libpthread-2.6.1.so) ==28593== by 0x440802D: clone (in /lib/libc-2.6.1.so) thanks for any help -- View this message in context: http://www.nabble.com/Initialize-a-char---to-use-sprintf-function-tp19056515p19060205.html Sent from the Valgrind - Users mailing list archive at Nabble.com. |