Quantcast
Channel: User trojanfoe - Stack Overflow
Viewing all articles
Browse latest Browse all 226

Comment by trojanfoe on C substring of variable length in a consistent file format

$
0
0
OK firstly you are reading the line data into line which is on the stack and you are returning a pointer to it. When the function goes out-of-scope the stack is reclaimed. Instead, you will need to strdup() it and the caller will need to free() it.

Viewing all articles
Browse latest Browse all 226

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>