Page 1 of 1

Blank Taharez look tooltip text causes a crash.

Posted: Wed May 12, 2010 08:00
by agamemnus
:(

Re: Blank Taharez look tooltip text causes a crash.

Posted: Wed May 12, 2010 09:31
by scriptkid
Did you try to debug? What does the log say?

Re: Blank Taharez look tooltip text causes a crash.

Posted: Wed May 12, 2010 15:39
by agamemnus
The log doesn't say anything after I load things.
The crash isn't in loading.
What I mean by blank is a string with 0 chars: "".
Tooltip works fine when the string is " ", for instance.

I didn't try to debug... too much hassle to recompile the debug version.

Doesn't it crash for you?

Re: Blank Taharez look tooltip text causes a crash.

Posted: Thu May 13, 2010 08:46
by CrazyEddie
The tooltip text for all windows is by default the empty string, so no, this does not happen normally.

I didn't try to debug... too much hassle to recompile the debug version.

Your attitude really does leave a lot to be desired. If you can't be bothered to try and help yourself, why should anybody else bother to help you either?

CE.

Re: Blank Taharez look tooltip text causes a crash.

Posted: Thu May 13, 2010 17:08
by agamemnus
Well, I thought it was something that everyone experienced... thus trying to help everyone... I will think about this... I think I might know the reason, but I need to test.

Re: Blank Taharez look tooltip text causes a crash.

Posted: Thu May 13, 2010 18:39
by agamemnus
When value is a *char, 'setProperty(name, value)' crashes when that char equals 0. Since the pointer to a blank char's data bit isn't stored anywhere, it becomes 0. 'setProperty(name, "")' doesn't crash, though.

Re: Blank Taharez look tooltip text causes a crash.

Posted: Mon May 17, 2010 16:36
by Jamarr
This is not a "help me learn c/c++ forum". I do not understand why you keep asking basic language questions in this forum.

Code: Select all

char* mystr1 = 0;
char* mystr2 = "";


These are not equivalent.

Re: Blank Taharez look tooltip text causes a crash.

Posted: Mon May 17, 2010 18:26
by agamemnus
The point is that it crashes when I send it 0, and it shouldn't.

Re: Blank Taharez look tooltip text causes a crash.

Posted: Mon May 17, 2010 19:24
by Jamarr
And why should it not crash? The function is specifically asking for a string. Is a null-pointer a string? No, it is not. Do you know what happens if you assign a null-pointer to the c++ standard std::string object? "Undefined behavior." And do you know why the c++ standard specifically states that this behavior is undefined? Because, again, a null-pointer is not a string. If it is not a string, then it certainly cannot be an empty-string, a partial string, or any type of string.

So the first problem is that you do not understand how c-strings work, or even what a string is; this is a core c++ concept that a proper teacher and/or book would have explained to you. Second, you obviously did not evaluate your code. How do I know this? Because it would have been obvious to you that "" is a pointer to a memory location with a value of 0; it is not the value 0. Third, had you actually taken the time to properly debug and step through your code you would have seen precisely where the problem occurs: CEGUI::String uses strlen, a standard c-string function, to determine the length of the c-string. If you had taken 5 minutes to google anything along the lines of "strlen null" your question would have been answered, you would not have wasted your time making this thread, you would not have wasted the time of everyone who posted in this thread, I would not have had to go off on you in another equally ridiculous thread, and your problem would have already been resolved.

I am not trying to be the villian here, but you are not making it easy for anyone to play the nice and helpful community member role when you insist on belittling our time.

Re: Blank Taharez look tooltip text causes a crash.

Posted: Mon May 17, 2010 19:26
by agamemnus
I've already established that it does not accept a null pointer several posts ago; in fact, 4 days ago.

Re: Blank Taharez look tooltip text causes a crash.

Posted: Mon May 17, 2010 19:47
by Jamarr
I know that you have a problem with the English language, but if you carefully read my post I clearly explained why this is not an issue.

As a suggestion, if you stop taking things so personally, calmly read and follow the suggestions I've given you, you will find it easier to receive help and others will be more willing to help you.

Re: Blank Taharez look tooltip text causes a crash.

Posted: Mon May 17, 2010 20:03
by agamemnus
Hi,
You asserted (among other things) that:
* it should crash if it receives a null pointer.
* I didn't know that it should crash if it receives a null pointer.

Do you disagree with this assessment?

I responded, saying:

"The point is that it crashes when I send it 0, and it shouldn't."
IE: it should not crash if it receives a null pointer, but instead replace the parameter value with a "" string.

"I've already established that it does not accept a null pointer several posts ago; in fact, 4 days ago."
IE: I already knew that it crashes if it receives a null pointer.

Re: Blank Taharez look tooltip text causes a crash.

Posted: Mon May 17, 2010 23:02
by Jamarr
"The point is that it crashes when I send it 0, and it shouldn't."
IE: it should not crash if it receives a null pointer, but instead replace the parameter value with a "" string.


As I've already explained, this is intended behavior. For some reason, you have this notion that the CEGUI library should encourage bad programming practices. My reasons for disagreeing have already been posted.

"I've already established that it does not accept a null pointer several posts ago; in fact, 4 days ago."
IE: I already knew that it crashes if it receives a null pointer.


You completely missed the point: there was no reason for you to start this thread to begin with. My early posts are already quite clear on this matter.

Re: Blank Taharez look tooltip text causes a crash.

Posted: Mon May 17, 2010 23:29
by agamemnus
As I've already explained, this is intended behavior. For some reason, you have this notion that the CEGUI library should encourage bad programming practices. My reasons for disagreeing have already been posted.

I already know what you think how it should work. That's not the issue. You are telling me that any other way is always wrong, and insulting and flame-baiting me all the way.

You completely missed the point: there was no reason for you to start this thread to begin with. My early posts are already quite clear on this matter.

I started the thread because I saw that passing a "" was crashing, which I later learned was turned into a null pointer in my programming language instead of an actual "". Later on, I posted a comment that it should accept 0 IE a null pointer. So yes, there was a reason to start this thread.

There was no reason for you to name-call and flame-bait me and pretend to teach me that which I already know.

Re: Blank Taharez look tooltip text causes a crash.

Posted: Tue May 18, 2010 17:07
by Jamarr
agamemnus wrote:I already know what you think how it should work. That's not the issue. You are telling me that any other way is always wrong, and insulting and flame-baiting me all the way.


Look, I am not trying to "flame-bait" you. I am simply stating what I see. And you should not take ignorance as an insult. We are all ignorant in different ways; the sooner everyone accepts that, the sooner we can all get along (and that goes for the whole world...). I am all for supporting users who attempt to diagnose their own problems, and when cornered, post all relevant information.

I explained why I disagreed with you. There is nothing wrong with debate; you should not take information that goes against your beliefs as insulting (just don't try telling that to a religious extremist...).

I started the thread because I saw that passing a "" was crashing, which I later learned was turned into a null pointer in my programming language instead of an actual "". Later on, I posted a comment that it should accept 0 IE a null pointer. So yes, there was a reason to start this thread. There was no reason for you to name-call and flame-bait me and pretend to teach me that which I already know.


First of all, I have never lowered myself to name-calling. Second, it is obvious from your previous posts that you did not understand the difference between 0 and ""; and from your other threads that you do not understand some of the core c++ or general programming concepts. I find it quite funny that you are now trying to clear your ignorance. I really cannot understand why you are so ashmed of it - I belive that everyone should embrace their ignorance.

Anyway, you've given no sensible reason as to why CEGUI should allow this behavior. And if the c++ standard does not allow this behavior, and they've debated this far longer than we ever will, I doubt you will ever derive to a sensible argument. Since this thread is no longer going anywhere, I'm ending it here.