aboutsummaryrefslogtreecommitdiffstats
path: root/plugins/mozjs.c
diff options
context:
space:
mode:
Diffstat (limited to 'plugins/mozjs.c')
-rw-r--r--plugins/mozjs.c16
1 files changed, 8 insertions, 8 deletions
diff --git a/plugins/mozjs.c b/plugins/mozjs.c
index 766df75..9d1ad6f 100644
--- a/plugins/mozjs.c
+++ b/plugins/mozjs.c
@@ -100,11 +100,11 @@ static JSBool myipaddress(JSContext *ctx, uintN argc, jsval *vp)
JS_SET_RVAL(ctx, vp, JSVAL_NULL);
- if (current_proxy == NULL)
+ if (!current_proxy)
return JS_TRUE;
interface = pacrunner_proxy_get_interface(current_proxy);
- if (interface == NULL)
+ if (!interface)
return JS_TRUE;
if (getaddr(interface, address, sizeof(address)) < 0)
@@ -157,11 +157,11 @@ static void create_object(void)
const char *script;
jsval rval;
- if (current_proxy == NULL)
+ if (!current_proxy)
return;
script = pacrunner_proxy_get_script(current_proxy);
- if (script == NULL)
+ if (!script)
return;
jsctx = JS_NewContext(jsrun, 8 * 1024);
@@ -187,7 +187,7 @@ static void create_object(void)
static void destroy_object(void)
{
- if (jsctx == NULL)
+ if (!jsctx)
return;
JS_DestroyContext(jsctx);
@@ -200,12 +200,12 @@ static int mozjs_set_proxy(struct pacrunner_proxy *proxy)
{
DBG("proxy %p", proxy);
- if (current_proxy != NULL)
+ if (current_proxy)
destroy_object();
current_proxy = proxy;
- if (current_proxy != NULL)
+ if (current_proxy)
create_object();
return 0;
@@ -219,7 +219,7 @@ static char * mozjs_execute(const char *url, const char *host)
DBG("url %s host %s", url, host);
- if (jsctx == NULL)
+ if (!jsctx)
return NULL;
pthread_mutex_lock(&mozjs_mutex);