binarycrusader / libproxy

Automatically exported from code.google.com/p/libproxy
GNU Lesser General Public License v2.1
0 stars 0 forks source link

typo in pacrunner_mozjs.cpp #171

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
static JSBool myIpAddress(JSContext *cx, uintN /*argc*/, jsval *vp) {
        char *hostname = (char *) JS_malloc(cx, 1024);
        if (!gethostname(hostname, 1023)) {
                JSString *myhost = JS_NewStringCopyN(cx, hostname, strlen(hostname));
                jsval arg = STRING_TO_JSVAL(myhost);
                return dnsResolve_(cx, 1, &arg);
                       ^^^^^^^^^^^

The prototype of dnsResolve_ is
JSBool dnsResolve_(JSContext *cx, jsval hostname, jsval *vp)

I think it should be dnsResolve(cx, 1, &arg);

The prototype of dnsResolve is
JSBool dnsResolve(JSContext *cx, uintN /*argc*/, jsval *vp)

Original issue reported on code.google.com by ginnc...@gmail.com on 30 Jan 2012 at 1:56

GoogleCodeExporter commented 9 years ago
It should be dnsResolve_(cx, arg, vp);
So we can get return value to vp.

Original comment by ginnc...@gmail.com on 30 Jan 2012 at 3:06

GoogleCodeExporter commented 9 years ago
Issue 174 has been merged into this issue.

Original comment by dominiqu...@gmail.com on 9 Mar 2012 at 5:42

GoogleCodeExporter commented 9 years ago
Thanks for spotting it and reporting it.
Fixed in r832

Original comment by dominiqu...@gmail.com on 9 Mar 2012 at 5:45

GoogleCodeExporter commented 9 years ago

Original comment by dominiqu...@gmail.com on 9 Mar 2012 at 5:45