From: discomfitor Date: Sun, 28 Aug 2011 06:30:51 +0000 (+0000) Subject: seriously guys. X-Git-Tag: submit/2.0alpha-wayland/20121127.222009~533 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=1d29519dbb7ce02e872ba9df0687d4738b07dea5;p=profile%2Fivi%2Feina.git seriously guys. null checks. why are there still functions that don't have them after we've hit 1.0? git-svn-id: http://svn.enlightenment.org/svn/e/trunk/eina@62900 7cbeb6ba-43b4-40fd-8cce-4c39aea84d33 --- diff --git a/src/lib/eina_file.c b/src/lib/eina_file.c index 6e39a6d..211912b 100644 --- a/src/lib/eina_file.c +++ b/src/lib/eina_file.c @@ -832,6 +832,7 @@ eina_file_open(const char *filename, Eina_Bool shared) EAPI void eina_file_close(Eina_File *file) { + if (!file) return; eina_lock_take(&file->lock); file->refcount--; eina_lock_release(&file->lock); @@ -843,18 +844,21 @@ eina_file_close(Eina_File *file) EAPI size_t eina_file_size_get(Eina_File *file) { + if (!file) return 0; return file->length; } EAPI time_t eina_file_mtime_get(Eina_File *file) { + if (!file) return 0; return file->mtime; } EAPI const char * eina_file_filename_get(Eina_File *file) { + if (!file) return NULL; return file->filename; }