Browse Source

ckdb - event code check items for null before using them :P

master
kanoi 9 years ago
parent
commit
a0fbee4ae5
  1. 2
      src/ckdb.h
  2. 2
      src/ckdb_data.c

2
src/ckdb.h

@ -51,7 +51,7 @@
#define DB_VLOCK "1" #define DB_VLOCK "1"
#define DB_VERSION "1.0.5" #define DB_VERSION "1.0.5"
#define CKDB_VERSION DB_VERSION"-2.004" #define CKDB_VERSION DB_VERSION"-2.005"
#define WHERE_FFL " - from %s %s() line %d" #define WHERE_FFL " - from %s %s() line %d"
#define WHERE_FFL_HERE __FILE__, __func__, __LINE__ #define WHERE_FFL_HERE __FILE__, __func__, __LINE__

2
src/ckdb_data.c

@ -4832,6 +4832,7 @@ int check_events(EVENTS *events)
DATA_EVENTS_NULL(e, e_item); DATA_EVENTS_NULL(e, e_item);
count = 0; count = 0;
// Remember the first username // Remember the first username
if (e_item)
STRNCPY(createby, e->createby); STRNCPY(createby, e->createby);
user2 = false; user2 = false;
while (e_item && e->id == events->id && while (e_item && e->id == events->id &&
@ -4891,6 +4892,7 @@ int check_events(EVENTS *events)
DATA_EVENTS_NULL(e, e_item); DATA_EVENTS_NULL(e, e_item);
count = 0; count = 0;
// Remember the first username // Remember the first username
if (e_item)
STRNCPY(createby, e->createby); STRNCPY(createby, e->createby);
user2 = false; user2 = false;
while (e_item && e->id == events->id && while (e_item && e->id == events->id &&

Loading…
Cancel
Save