Introduction
Introduction Statistics Contact Development Disclaimer Help
Simplified mechanism for null-terminating main buffer - fiche - A pastebin adju…
git clone git://vernunftzentrum.de/fiche.git
Log
Files
Refs
LICENSE
---
commit 10129c83025214df7d9a9ef629835fba26410618
parent 288bf2ef84f67bb5e631fd239a7dda41a0d3773b
Author: solusipse <[email protected]>
Date: Thu, 19 Oct 2017 22:18:57 +0200
Simplified mechanism for null-terminating main buffer
Diffstat:
fiche.c | 7 +------
1 file changed, 1 insertion(+), 6 deletions(-)
---
diff --git a/fiche.c b/fiche.c
@@ -761,12 +761,7 @@ static int save_to_file(const Fiche_Settings *s, uint8_t *…
}
// Null-terminate buffer if not null terminated already
- for (int i = 0; i < s->buffer_len; i++) {
- if (data[i] == 0) {
- break;
- }
- data[s->buffer_len - 1] = 0;
- }
+ data[s->buffer_len - 1] = 0;
if ( fprintf(f, "%s", data) < 0 ) {
fclose(f);
You are viewing proxied material from vernunftzentrum.de. The copyright of proxied material belongs to its original authors. Any comments or complaints in relation to proxied material should be directed to the original authors of the content concerned. Please see the disclaimer for more details.