Skip to content

Commit

Permalink
Fixed dlist allocation to match documentation
Browse files Browse the repository at this point in the history
2mac committed Dec 31, 2014
1 parent 0634b00 commit fef9e97
Showing 5 changed files with 10 additions and 8 deletions.
2 changes: 1 addition & 1 deletion Makefile.am
Original file line number Diff line number Diff line change
@@ -5,7 +5,7 @@ dist_pkgconfig_DATA = cquel.pc

include_HEADERS = cquel.h
lib_LTLIBRARIES = libcquel.la
libcquel_la_LDFLAGS = -version-info 6:0:2
libcquel_la_LDFLAGS = -version-info 6:1:2
libcquel_la_SOURCES = cquel.c cqstatic.c
libcquel_la_CFLAGS = -Wall -Wextra -std=c11 `mysql_config --cflags --libs`

2 changes: 1 addition & 1 deletion configure.ac
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
AC_PREREQ([2.60])
define(_COPYRIGHT_YEAR, 2014)
AC_INIT([libcquel],[4.4],[support@delwink.com])
AC_INIT([libcquel],[4.5],[support@delwink.com])

AC_CONFIG_SRCDIR([cquel.c])
AC_CONFIG_AUX_DIR([build-aux])
7 changes: 4 additions & 3 deletions cquel.c
Original file line number Diff line number Diff line change
@@ -149,10 +149,10 @@ int cq_drow_set(struct drow *row, char * const *values)
struct dlist *cq_new_dlist(size_t fieldc, char * const *fieldnames,
const char *primkey)
{
bool hasprim = NULL != primkey;

if (fieldnames == NULL)
return NULL;
if (strlen(primkey) >= CQ_FMAXLEN)
return NULL;

struct dlist *list = malloc(sizeof(struct dlist));
if (list == NULL)
@@ -200,7 +200,8 @@ struct dlist *cq_new_dlist(size_t fieldc, char * const *fieldnames,
free(list);
return NULL;
}
strcpy(list->primkey, primkey);
if (hasprim)
strcpy(list->primkey, primkey);

list->first = NULL;
list->last = NULL;
4 changes: 2 additions & 2 deletions cquel.h
Original file line number Diff line number Diff line change
@@ -17,7 +17,7 @@

/**
* @file cquel.h
* @version 4.4
* @version 4.5
* @date 12/27/2014
* @authors David McMackins II, Darcy Brás da Silva
* @brief MySQL C API wrapper with dynamic data structures
@@ -36,7 +36,7 @@
/**
* @brief The cquel software version number.
*/
#define CQ_VERSION "4.4"
#define CQ_VERSION "4.5"

/**
* @brief Information about the cquel copyright holders and license.
3 changes: 2 additions & 1 deletion doc/structures.md
Original file line number Diff line number Diff line change
@@ -9,7 +9,8 @@ to determine how to connect to the database.

``` c
struct dbconn {
MYSQL *con;
void *con;
bool isopen;
const char *host;
const char *user;
const char *passwd;

0 comments on commit fef9e97

Please sign in to comment.