diff options
| author | Dirk Engling <erdgeist@erdgeist.org> | 2026-10-23 22:10:58 +0200 |
|---|---|---|
| committer | Dirk Engling <erdgeist@erdgeist.org> | 2026-10-23 22:10:58 +0200 |
| commit | 280344488f09ff29deb052dfa94ed74668c00b18 (patch) | |
| tree | 4d4ce5abeabe0ad34e9d91f6c8e8637a4d8ed23a /ot_sync.c | |
| parent | de67a4a721c0fda9a9b5955f235baafba9ba393d (diff) | |
Remove last byte_diff and provide more prototypes
Diffstat (limited to 'ot_sync.c')
| -rw-r--r-- | ot_sync.c | 9 |
1 files changed, 4 insertions, 5 deletions
| @@ -12,7 +12,6 @@ | |||
| 12 | #include <sys/uio.h> | 12 | #include <sys/uio.h> |
| 13 | 13 | ||
| 14 | /* Libowfat */ | 14 | /* Libowfat */ |
| 15 | #include "byte.h" | ||
| 16 | #include "io.h" | 15 | #include "io.h" |
| 17 | #include "scan.h" | 16 | #include "scan.h" |
| 18 | 17 | ||
| @@ -36,15 +35,15 @@ int add_changeset_to_tracker(uint8_t *data, size_t len) { | |||
| 36 | uint8_t *end = data + len; | 35 | uint8_t *end = data + len; |
| 37 | unsigned long peer_count; | 36 | unsigned long peer_count; |
| 38 | 37 | ||
| 39 | /* We do know, that the string is \n terminated, so it cant | 38 | /* We do know, that the string is \n terminated, so it can't |
| 40 | overflow */ | 39 | overflow */ |
| 41 | if (byte_diff(data, 8, "d4:syncd")) | 40 | if (!memcmp(data, "d4:syncd", 8)) |
| 42 | return -1; | 41 | return -1; |
| 43 | data += 8; | 42 | data += 8; |
| 44 | 43 | ||
| 45 | while (1) { | 44 | while (1) { |
| 46 | if (byte_diff(data, 3, "20:")) { | 45 | if (!memcmp(data, "20:", 3)) { |
| 47 | if (byte_diff(data, 2, "ee")) | 46 | if (!memcmp(data, "ee", 2)) |
| 48 | return -1; | 47 | return -1; |
| 49 | return 0; | 48 | return 0; |
| 50 | } | 49 | } |
