This discussion has been locked.
You can no longer post new replies to this discussion. If you have a question you can start a new discussion

sprintf ()

Hello!

Some time ago I had a problem with sprintf(), it just didn't change the string variable as it should have. The problem somehow vanished, and I had no time to investigate further...

Now I have the same problem again, here's a snippet:

char xdata c [80];
strcpy (c, "Text"); 
sprintf (c, "%s", "Text2");
The strcpy command works fine, the content of c is "Text" after execution.
The sprintf command (also any other variation of sprintf, no matter if %d, %c, %s, etc) does not change the contents of c.
The memory model is LARGE.

Now, here comes a weird detail: also in xdata, I have a large array. If I make this array smaller, the sprintf command works again.
Does maybe sprintf itself "need" memory in xdata, which it maybe cannot allocate anymore because there's no space?
The only thing I change to make it work is to use less xdata memory.

I don't get any error messages from compiler or linker.

Thank you for any help!
Holger

0