-
-
Notifications
You must be signed in to change notification settings - Fork 178
Open
Labels
bugUnexpected behavior / crashes; to be fixed ASAP!Unexpected behavior / crashes; to be fixed ASAP!optimizationThis increases performance or decreases sizeThis increases performance or decreases sizerefactoringThis PR is intended to clean up code more than change functionalityThis PR is intended to clean up code more than change functionalityrgbasmThis affects RGBASMThis affects RGBASMrgbfixThis affects RGBFIXThis affects RGBFIXrgbgfxThis affects RGBGFXThis affects RGBGFXrgblinkThis affects RGBLINKThis affects RGBLINK
Milestone
Description
RGBDS comprises four programs, all of which have multiple kinds of input and/or output. There are a number of issues with how they implement that:
- Implementations are scattered, often duplicating functionality (such as handling of
-
for stdin/stdout). -
read()
/fread()
might read fewer bytes than you requested, e.g. if the file is a pipe. That's not an error, it just means you need to loop more calls until finished. - Unlimited-length pseudo-device files like
/dev/zero
and/dev/urandom
can behave oddly. For example,INCBIN "/dev/zero"
hangs indefinitely. - Potential TOCTTOU race conditions between finding a definite file path among the
-I
nclude directories withfstk_FindFile
, and actually opening the file.
We would probably benefit from more high-level C++ STL file I/O, since we're manually doing things with read()
, fread()
, std::filebuf
, etc, when std::ifstream
exists.
Metadata
Metadata
Assignees
Labels
bugUnexpected behavior / crashes; to be fixed ASAP!Unexpected behavior / crashes; to be fixed ASAP!optimizationThis increases performance or decreases sizeThis increases performance or decreases sizerefactoringThis PR is intended to clean up code more than change functionalityThis PR is intended to clean up code more than change functionalityrgbasmThis affects RGBASMThis affects RGBASMrgbfixThis affects RGBFIXThis affects RGBFIXrgbgfxThis affects RGBGFXThis affects RGBGFXrgblinkThis affects RGBLINKThis affects RGBLINK