
-----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 On Tue, 04 Nov 2003 21:30:54 +0000 John Lamb <J.D.Lamb@btinternet.com> wrote:
Richard Bos wrote:
{ ...... const char *operation; .... case Item::RPMUpgrade: if (Interactive) operation = "-Uvh"; else operation = "-Uv"; break; .... cout << _("Executing RPM (")<<operation<<")..." << endl;
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 <gaf@blu.org> Boston Linux and Unix user group http://www.blu.org PGP key id:C5061EA9 PGP Key fingerprint:053C 73EC 3AC1 5C44 3E14 9245 FB00 3ED5 C506 1EA9 -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.2.2-rc1-SuSE (GNU/Linux) iD8DBQE/rPm6+wA+1cUGHqkRAnkqAJ0VhN0zUVTKynKYlPJomf3zZY3WFgCfYkjC hQb/b1Ul9roETBVJ8jK9AYE= =kaNO -----END PGP SIGNATURE-----