Lines Matching defs:buf
201 char *buf;
209 buf = load_file(LAST_KMSG_PATH, &sz);
210 if (!buf || !sz) {
216 ptr = buf + (sz - len);
236 free(buf);
244 static int read_file(const char *path, char *buf, size_t sz)
253 cnt = read(fd, buf, sz - 1);
256 buf[cnt] = '\0';
257 if (buf[cnt - 1] == '\n') {
259 buf[cnt] = '\0';
273 char buf[32];
278 ret = read_file(path, buf, sizeof(buf));
282 tmp = strtol(buf, &end, 0);
283 if (end == buf ||
284 ((end < buf+sizeof(buf)) && (*end != '\n' && *end != '\0')))