summaryrefslogtreecommitdiff
path: root/ff2ppm.c
diff options
context:
space:
mode:
authorLaslo Hunhold <dev@frign.de>2017-04-14 17:32:12 +0200
committerLaslo Hunhold <dev@frign.de>2017-04-14 17:36:49 +0200
commit42678350147b13345174f1e4c637a89c442ffd3c (patch)
tree21f301eb1b81e537125e1750a04c2cb9695846af /ff2ppm.c
parent65435b097b355105dc9a32f87ed80427d56b1c91 (diff)
Refactor 2ff(1)
The Unix philosophy teaches us that tools should strive to output only necessary diagnostic information and also reflect errors properly with the return value. There were three subtle problems with 2ff: 1) If the farbfeld-passthrough failed, it would return 1 instead of 1. 2) If the first 8 bytes contained a NUL byte, bash would print an ugly warning message. Passing it through tr -d '\0' fixes that. 3) Lack of comments. I added some to make the structure even clearer, also including using an if-else-structure. I removed the 2ff error message; the tools themselves print proper messages already.
Diffstat (limited to 'ff2ppm.c')
0 files changed, 0 insertions, 0 deletions