Xinqi Bao's Git
98c5fc5c5e29931da23fd02801da0b4be6e98da7
10 bprintf(const char *fmt
, ...)
16 len
= vsnprintf(buf
, sizeof(buf
) - 1, fmt
, ap
);
19 if (len
>= sizeof(buf
))
20 buf
[sizeof(buf
)-1] = '\0';
26 pscanf(const char *path
, const char *fmt
, ...)
32 if (!(fp
= fopen(path
, "r"))) {
33 warn("fopen %s: %s\n", path
, strerror(errno
));
37 n
= vfscanf(fp
, fmt
, ap
);
41 return (n
== EOF
) ? -1 : n
;