null+****@clear*****
null+****@clear*****
2011年 11月 14日 (月) 18:16:09 JST
Susumu Yata 2011-11-14 09:16:09 +0000 (Mon, 14 Nov 2011) New Revision: b780346dbbd616aae138d40b427a2b7cd03bd1bc Log: change to return GRN_INVALID_ARGUMENT when a given path is null. Modified files: lib/dat.cpp Modified: lib/dat.cpp (+6 -2) =================================================================== --- lib/dat.cpp 2011-11-13 12:06:48 +0000 (7f626c4) +++ lib/dat.cpp 2011-11-14 09:16:09 +0000 (5b67a79) @@ -302,6 +302,11 @@ grn_dat_close(grn_ctx *ctx, grn_dat *dat) grn_rc grn_dat_remove(grn_ctx *ctx, const char *path) { + if (!path) { + ERR(GRN_INVALID_ARGUMENT, const_cast<char *>("path is null")); + return GRN_INVALID_ARGUMENT; + } + grn_dat * const dat = grn_dat_open(ctx, path); if (!dat) { return ctx->rc; @@ -316,8 +321,7 @@ grn_dat_remove(grn_ctx *ctx, const char *path) break; } } - grn_io_remove(ctx, path); - return ctx->rc; + return grn_io_remove(ctx, path); } grn_id