]> git.saurik.com Git - cycript.git/blobdiff - Library.cpp
Removed a null-termination usage in Replace for concatenation of strings.
[cycript.git] / Library.cpp
index 383008a80328a899ffc4501b86a9e51790018672..2289e37ca0ed898746dc4f8539ad56d88a3d5437 100644 (file)
@@ -539,7 +539,7 @@ static size_t Nonce_(0);
 
 static JSValueRef $cyq(JSContextRef context, JSObjectRef object, JSObjectRef _this, size_t count, const JSValueRef arguments[], JSValueRef *exception) {
     CYPool pool;
-    const char *name(apr_psprintf(pool, "%s%zu", CYPoolCString(pool, context, arguments[0]), Nonce_++));
+    const char *name(apr_psprintf(pool, "%s%"APR_SIZE_T_FMT"", CYPoolCString(pool, context, arguments[0]), Nonce_++));
     return CYCastJSValue(context, name);
 }
 
@@ -816,8 +816,7 @@ JSValueRef CYFromFFI(JSContextRef context, sig::Type *type, ffi_type *ffi, void
                 if (JSValueRef value = (*hooks_->FromFFI)(context, type, ffi, data, initialize, owner))
                     return value;
 
-            fprintf(stderr, "CYFromFFI(%c)\n", type->primitive);
-            _assert(false);
+            CYThrow("failed conversion from FFI format: '%c'\n", type->primitive);
     }
 }