Follow

Keep Up to Date with the Most Important News

By pressing the Subscribe button, you confirm that you have read and are agreeing to our Privacy Policy and Terms of Use
Contact

conditional jump or move depends on uninitialized value(s)

I’m not too sure how to troubleshoot or understand what could be happening, any help would be appreciated and if there is any clarification needed I would be more than happy to provide, Thanks!

>Solution :

MEDevel.com: Open-source for Healthcare and Education

Collecting and validating open-source software for healthcare, education, enterprise, development, medical imaging, medical records, and digital pathology.

Visit Medevel

The string you’re constructing in ran doesn’t have a terminating null byte, so atoi will read past the bytes you’ve written into the ones you haven’t (and possibly past the end of the array), which is what valgrind is telling you.

You’ll need to manually terminate the string after reading the characters.

while(line[i] != ',') {
     ran[k] = line[i];
     i = i + 1;
     k = k + 1;
}
ran[k] = 0;
Add a comment

Leave a Reply

Keep Up to Date with the Most Important News

By pressing the Subscribe button, you confirm that you have read and are agreeing to our Privacy Policy and Terms of Use

Discover more from Dev solutions

Subscribe now to keep reading and get access to the full archive.

Continue reading