diff --git a/clibrary.c b/clibrary.c index 0dfec0f..1f51da5 100644 --- a/clibrary.c +++ b/clibrary.c @@ -246,7 +246,7 @@ void GenericPrintf(struct ParseState *Parser, struct Value *ReturnValue, struct NextArg = (struct Value *)((char *)NextArg + sizeof(struct Value) + TypeStackSizeValue(NextArg)); if (NextArg->Typ != FormatType && !((FormatType == &IntType || *FPos == 'f') && IS_NUMERIC_COERCIBLE(NextArg)) && - !(FormatType == CharPtrType && ( (NextArg->Typ->Base == TypePointer && NextArg->Typ->FromType->Base == TypeArray && NextArg->Typ->FromType->FromType->Base == TypeChar) || + !(FormatType == CharPtrType && (NextArg->Typ->Base == TypePointer || (NextArg->Typ->Base == TypeArray && NextArg->Typ->FromType->Base == TypeChar) ) ) ) PrintStr("XXX", Stream); /* bad type for format */ else @@ -257,7 +257,7 @@ void GenericPrintf(struct ParseState *Parser, struct Value *ReturnValue, struct { char *Str; - if (NextArg->Typ == CharPtrType || (NextArg->Typ->Base == TypePointer && NextArg->Typ->FromType->Base == TypeArray && NextArg->Typ->FromType->FromType->Base == TypeChar) ) + if (NextArg->Typ->Base == TypePointer) { #ifndef NATIVE_POINTERS struct Value *CharArray = NextArg->Val->Pointer.Segment; diff --git a/expression.c b/expression.c index 976e630..009a133 100644 --- a/expression.c +++ b/expression.c @@ -312,7 +312,7 @@ void ExpressionAssignToPointer(struct ParseState *Parser, struct Value *ToValue, ToValue->Val->Pointer.Offset = 0; DerefVal = FromValue; #else - ToValue->Val->NativePointer = FromValue; + ToValue->Val->NativePointer = FromValue->Val->Array.Data; #endif } else if (FromValue->Typ->Base == TypePointer && FromValue->Typ->FromType->Base == TypeArray && PointedToType == FromValue->Typ->FromType->FromType)