[0.13.6] [Oxyd] game.write_file handles data as zero terminated str

This subforum contains all the issues which we already resolved.
Post Reply
gheift
Fast Inserter
Fast Inserter
Posts: 188
Joined: Tue Mar 03, 2015 9:20 pm
Contact:

[0.13.6] [Oxyd] game.write_file handles data as zero terminated str

Post by gheift »

I created a lua function (see viewtopic.php?f=69&t=28550), which generates an image of the map (is there a native function for it?). Therefore I wanted to write a "\0" byte out (for coal) and detected data is handled as zero terminated string and not as a buffer and length.

Code: Select all

/c game.write_file("test.txt", string.char(65, 0, 66))
I expect the file to contain three bytes: "A\0B", but it contains only "A".

Oxyd
Former Staff
Former Staff
Posts: 1428
Joined: Thu May 07, 2015 8:42 am
Contact:

Re: [0.13.6] [Oxyd] game.write_file handles data as zero terminated str

Post by Oxyd »

Fixed in 0.13.7.

gheift
Fast Inserter
Fast Inserter
Posts: 188
Joined: Tue Mar 03, 2015 9:20 pm
Contact:

Re: [0.13.6] [Oxyd] game.write_file handles data as zero terminated str

Post by gheift »

Thanks!

Post Reply

Return to “Resolved Problems and Bugs”