kumori0 wrote:
> Hello everyone, 
> 
> Could someone please tell me how to solve the following two problems
> in my program. 
> You can see the whole program here: http://pastebin.com/m65d16ab4
> 
> My first problem is the following valgrind message:
> 
> [EMAIL PROTECTED]:~/ws/ospo08/v03n1$ valgrind -q ./prestej tekst.txt pivo
> ==16506== Conditional jump or move depends on uninitialised value(s)
> ==16506==    at 0x40092D: myMemCmp (prestej.c:108)
> ==16506==    by 0x400A37: prestej (prestej.c:149)
> ==16506==    by 0x400B52: main (prestej.c:179)
> ==16506== 
> ==16506== Conditional jump or move depends on uninitialised value(s)
> ==16506==    at 0x40093B: myMemCmp (prestej.c:110)
> ==16506==    by 0x400A37: prestej (prestej.c:149)
> ==16506==    by 0x400B52: main (prestej.c:179)
> 
> I don't know which value is uninitialised. Just can't spot the little
> bugger and it's driving me crazy. 
> 
> Thanks in advance for the help, 
> Janko

Looks like it just doesn't like the do {} while; loop.  You've got a 
serious problem if NULL is passed in for any of the pointers or 0 is 
passed in for the length.

         char buf[strLen];

I wouldn't do that either.  Use malloc()/free().  That method is just 
asking for a buffer overflow exploit.

-- 
Thomas Hruska
CubicleSoft President
Ph: 517-803-4197

*NEW* MyTaskFocus 1.1
Get on task.  Stay on task.

http://www.CubicleSoft.com/MyTaskFocus/

Reply via email to