Skip to content

Commit 28f8de9

Browse files
committed
Fix buildhelper
1 parent 9f19d64 commit 28f8de9

File tree

2 files changed

+13
-3136
lines changed

2 files changed

+13
-3136
lines changed

cmd/buildhelper.um

+5-3
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,8 @@ fn peekn(f: std.File, next: int): int {
2727
}
2828

2929
fn loadFF*(path: str): ([]uint32, int, int, int) {
30-
f := std.fopen(path, "r")
30+
f, err := std.fopen(path, "r")
31+
std.exitif(err)
3132
if f == null { return []uint32{}, -1, -1, 1 }
3233
var w, h: int
3334
var tr: []uint32
@@ -57,7 +58,7 @@ fn readall(f: std.File): str {
5758

5859
for ok := true; ok {
5960
var buff: [blockSize + 1]char
60-
ok = std.fread(f, ^[blockSize]char(&buff)) == 1
61+
ok = std.fread(f, ^[blockSize]char(&buff)).item1.code == 0
6162
res += str([]char(buff))
6263
}
6364

@@ -106,7 +107,8 @@ fn main() {
106107
printf("const char *%s[] = {\n", std.argv(2))
107108

108109
for i:=3; i < std.argc(); i++ {
109-
f := std.fopen(std.argv(i), "r")
110+
f, err := std.fopen(std.argv(i), "r")
111+
std.exitif(err)
110112
data := readall(f)
111113
printf("%s\n", strtoc(data)+",")
112114
std.fclose(f)

0 commit comments

Comments
 (0)