Browse Source

Fixed unallocated pointer freeing, added "examples" target in root Makefile

master
Ivan Polyakov 2 years ago
parent
commit
cae7d3e1cb
  1. 4
      Makefile
  2. 3
      c/query.c
  3. 2
      config.mk
  4. 4
      examples/.gitignore

4
Makefile

@ -38,6 +38,10 @@ uninstall:
rm -f $(PREFIX)/lib/librapidaxx.so* rm -f $(PREFIX)/lib/librapidaxx.so*
rm -rf $(PREFIX)/include/rapida rm -rf $(PREFIX)/include/rapida
#target Examples
examples: all
cd $@ && make
#target Shared C library #target Shared C library
librapida.so: $(COBJ) librapida.so: $(COBJ)
$(CC) -shared $^ -o $@ $(LDFLAGS) $(CC) -shared $^ -o $@ $(LDFLAGS)

3
c/query.c

@ -11,9 +11,6 @@ int rpd_query_parse(rpd_keyval *dest, const char *src)
{ {
int len = count_char_entries(src, '='); int len = count_char_entries(src, '=');
if (!len) { if (!len) {
if (dest->items) {
free(dest->items);
}
dest->items = NULL; dest->items = NULL;
dest->capacity = 0; dest->capacity = 0;
dest->size = 0; dest->size = 0;

2
config.mk

@ -1,4 +1,4 @@
VERSION=0.2.0 VERSION=0.2.1
#arg Installation prefix #arg Installation prefix
PREFIX=/usr/local PREFIX=/usr/local

4
examples/.gitignore vendored

@ -0,0 +1,4 @@
c/*
cxx/*
!c/*.c*
!cxx/*.c*
Loading…
Cancel
Save