Run-length encoding/C: Difference between revisions

Content added Content deleted
(Removed extra loop from the rle_decode() which resulted to incorrect return value and strange output.)
(now the sample compiles with gcc-4.4.1 on Ubuntu)
Line 57: Line 57:
int main()
int main()
{
{
char *d = malloc(2*strlen(o));
char *d = (char *)malloc(2*strlen(o));
char *oc = malloc(strlen(o));
char *oc = (char *)malloc(strlen(o));
int rl = rle_encode(d, o, strlen(o));
int rl = rle_encode(d, o, strlen(o));