quotearg: do not read beyond end of buffer