Changeset: 68d03f6b674f for MonetDB
URL: http://dev.monetdb.org/hg/MonetDB?cmd=changeset;node=68d03f6b674f
Modified Files:
monetdb5/extras/rapi/rapi.c
monetdb5/modules/atoms/json.c
Branch: Oct2014
Log Message:
Minor issues discovered by Coverity.
diffs (41 lines):
diff --git a/monetdb5/extras/rapi/rapi.c b/monetdb5/extras/rapi/rapi.c
--- a/monetdb5/extras/rapi/rapi.c
+++ b/monetdb5/extras/rapi/rapi.c
@@ -42,7 +42,6 @@
// other headers
#include <string.h>
-#include <sys/stat.h>
//#define _RAPI_DEBUG_
@@ -346,16 +345,13 @@ int RAPIinstalladdons(void) {
char rlibs[BUFSIZ];
char rapiinclude[BUFSIZ];
SEXP librisexp;
- struct stat sb;
// r library folder, create if not exists
snprintf(rlibs, BUFSIZ, "%s%c%s", GDKgetenv("gdk_dbpath"), DIR_SEP,
"rapi_packages");
- if (stat(rlibs, &sb) != 0) {
- if (mkdir(rlibs, S_IRWXU) != 0) {
- return 4;
- }
+ if (mkdir(rlibs, S_IRWXU) != 0 && errno != EEXIST) {
+ return 4;
}
#ifdef _RAPI_DEBUG_
printf("# R libraries installed in %s\n",rlibs);
diff --git a/monetdb5/modules/atoms/json.c b/monetdb5/modules/atoms/json.c
--- a/monetdb5/modules/atoms/json.c
+++ b/monetdb5/modules/atoms/json.c
@@ -1719,6 +1719,7 @@ JSONgroupStr(str *ret, const bat *bid)
GDKfree(buf);
throw(MAL, "json.agg", RUNTIME_OBJECT_MISSING);
}
+ assert(b->ttype == TYPE_str || b->ttype == TYPE_dbl);
strcpy(buf, str_nil);
offset = 0;
_______________________________________________
checkin-list mailing list
[email protected]
https://www.monetdb.org/mailman/listinfo/checkin-list