<div dir="ltr">The unbounded %[] here made me look at the kernel, where the size of a<br>block device name is limited to 32 bytes (including the NUL), so<br>although the 1024 bytes of toybuf was plenty, that meant that the<br>32-byte buffer for "/dev/%s" was too small because the "%s" alone could<br>require the entire buffer. Fix that, and simplify the code a bit by only<br>using toybuf for the fgets(). I didn't switch to fscanf() because the<br>file has two lines of headers, and calling fgets() twice to skip the<br>header seemed more awkward than keeping the continue in the loop.<br>---<br> toys/other/blkid.c | 7 +++----<br> 1 file changed, 3 insertions(+), 4 deletions(-)<br></div>