Revision c81e8439 som/Tests/chunk_encoding_test.c

View differences:

som/Tests/chunk_encoding_test.c
5 5
 */
6 6

  
7 7
#include <stdint.h>
8
#include <stdlib.h>
8 9
#include <stdio.h>
9 10
#include <string.h>
10 11
#include "chunk.h"
......
38 39
  src_c.id = 666;
39 40
  src_c.timestamp = 1000000000ULL;
40 41
  src_c.size = strlen("ciao") + 1;
41
  src_c.data = (uint8_t *)"ciao";
42
  src_c.data = strdup("ciao");
42 43
  src_c.attributes_size = 0;
43 44

  
44 45
  chunk_print(stdout, &src_c);
......
49 50
  fprintf(stdout, "Encoding in 23 bytes: %d\n", res);
50 51
  res = encodeChunk(&src_c, buff, sizeof(buff));
51 52
  fprintf(stdout, "Encoding in %d bytes: %d\n", sizeof(buff), res);
53
  free(src_c.data);
52 54

  
53 55
  res = decodeChunk(&dst_c, buff, res);
54 56
  fprintf(stdout, "Decoding it: %d\n", res);

Also available in: Unified diff