|
From: Cary R. <cy...@ya...> - 2018-01-09 07:39:17
|
NULL bytes in a string is always dangerous. The strlen() is just being used to determine the number of bytes (what $fgets() returns). It returns the bytes read as a string to the first argument which the runtime is likely correctly using the NULL byte to indicate the end of the string.
I agree with Niels that $fread() is a better choice. If you need more control than look at $fscanf().
Cary
On Monday, January 8, 2018, 11:13:45 PM PST, Niels Möller <ni...@ly...> wrote:
Martin Whitaker <ic...@ma...> writes:
> To work round this, try using $fgetc.
Wouldn't $fread be a more natural choice for reading binary files?
Regards,
/Niels
--
Niels Möller. PGP-encrypted email is preferred. Keyid 368C6677.
Internet email is subject to wholesale government surveillance.
------------------------------------------------------------------------------
Check out the vibrant tech community on one of the world's most
engaging tech sites, Slashdot.org! http://sdm.link/slashdot
_______________________________________________
Iverilog-devel mailing list
Ive...@li...
https://lists.sourceforge.net/lists/listinfo/iverilog-devel
|