ca198ee9fcaaefe6f47d7e5d8398b484955449db
4 * Copyright (C) 2012 Gabor Juhos <juhosg@openwrt.org>
6 * This program is free software; you can redistribute it and/or modify it
7 * under the terms of the GNU General Public License version 2 as published
8 * by the Free Software Foundation.
15 #include <sys/types.h>
19 int rle_decode(const unsigned char *src
, size_t srclen
,
20 unsigned char *dst
, size_t dstlen
,
21 size_t *src_done
, size_t *dst_done
)
23 size_t srcpos
, dstpos
;
31 if (!src
|| !srclen
|| !dst
|| !dstlen
)
40 count
= (signed char) src
[srcpos
++];
68 dst
[dstpos
++] = src
[srcpos
++];