-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1
On Tue, 04 Nov 2003 21:30:54 +0000
John Lamb
Richard Bos wrote:
{ ...... const char *operation; .... case Item::RPMUpgrade: if (Interactive) operation = "-Uvh"; else operation = "-Uv"; break; .... cout << _("Executing RPM (")<
Have you tried putting a null character at the end of the strings: i.e.
operation = "-Uvh\0"
This is a C-style string - I try to avoid them because std::string is better - and should be null terminated. I think the compiler should null terminate the strings for you, but if it doesn't it should just spew out what it finds as characters until it finds a null character or segfaults. That may be what you're seeing.
The literal string (e.g. "xxxxxx") is always nul terminated in C or C++.
And, std::string uses the c-string internally.
In any case, from the looks of the garbage, I'm wondering if Richard
might have a problem with the locale. I don't suspect that the problem
is with the iostream package per se.
- --
Jerry Feldman