diff options
-rw-r--r-- | src/persistence_client_library_key.c | 11 |
1 files changed, 7 insertions, 4 deletions
diff --git a/src/persistence_client_library_key.c b/src/persistence_client_library_key.c index 2b2f6cd..3b481b8 100644 --- a/src/persistence_client_library_key.c +++ b/src/persistence_client_library_key.c @@ -109,7 +109,7 @@ int pclKeyHandleOpen(unsigned int ldbid, const char* resource_id, unsigned int u int pclKeyHandleClose(int key_handle) { - int rval = EPERS_NOT_INITIALIZED; + int rval = 1; //DLT_LOG(gDLTContext, DLT_LOG_INFO, DLT_STRING("pclKeyHandleClose: "), // DLT_INT(gKeyHandleArray[key_handle].info.context.ldbid), DLT_STRING(gKeyHandleArray[key_handle].resourceID) ); @@ -137,16 +137,19 @@ int pclKeyHandleClose(int key_handle) } // invalidate entries - strncpy(gKeyHandleArray[key_handle].dbPath, "", DbPathMaxLen); - strncpy(gKeyHandleArray[key_handle].dbKey ,"", DbKeyMaxLen); + memset(gKeyHandleArray[key_handle].dbPath, 0, DbPathMaxLen); + memset(gKeyHandleArray[key_handle].dbKey ,0, DbKeyMaxLen); gKeyHandleArray[key_handle].info.configKey.storage = -1; - rval = 1; } else { rval = EPERS_MAXHANDLE; } } + else + { + rval = EPERS_NOT_INITIALIZED; + } return rval; } |