Skip to content

Commit 8bc5270

Browse files
committed
[fix] memcpy in geohash, closes #707
1 parent 019f9ae commit 8bc5270

File tree

1 file changed

+1
-3
lines changed

1 file changed

+1
-3
lines changed

src/geohash/geohash.c

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -391,9 +391,7 @@ static int uint8s_plus_minus(uint8_t *src, uint8_t *dst, size_t length, int plus
391391
return 0;
392392
}
393393
unsigned int cell = (length-1)/8;
394-
for (unsigned int i=0; i<cell; i++) {
395-
dst[cell] = src[cell];
396-
}
394+
memcpy(dst, src, cell);
397395
uint8_t cell_offset = (8-length%8)%8;
398396
int up = 1;
399397
while (up) {

0 commit comments

Comments
 (0)