Blank Taharez look tooltip text causes a crash.
Moderators: CEGUI MVP, CEGUI Team
- scriptkid
- Home away from home
- Posts: 1178
- Joined: Wed Jan 12, 2005 12:06
- Location: The Hague, The Netherlands
- Contact:
Re: Blank Taharez look tooltip text causes a crash.
Did you try to debug? What does the log say?
Check out my released snake game using Cegui!
Re: Blank Taharez look tooltip text causes a crash.
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?
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?
- CrazyEddie
- CEGUI Project Lead
- Posts: 6760
- Joined: Wed Jan 12, 2005 12:06
- Location: England
- Contact:
Re: Blank Taharez look tooltip text causes a crash.
The tooltip text for all windows is by default the empty string, so no, this does not happen normally.
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.
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.
Useful Links: Forum Guidelines | Documentation | Tutorials | HOWTO | Videos | Donate to CEGUI | CEGUI Twitter
Re: Blank Taharez look tooltip text causes a crash.
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.
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.
This is not a "help me learn c/c++ forum". I do not understand why you keep asking basic language questions in this forum.
These are not equivalent.
Code: Select all
char* mystr1 = 0;
char* mystr2 = "";
These are not equivalent.
If somebody helps you by replying to your thread, upvote him/her as a thanks! Make sure to include your CEGUI.log and everything you tried when posting! And remember that we are not magicians!
Re: Blank Taharez look tooltip text causes a crash.
The point is that it crashes when I send it 0, and it shouldn't.
Re: Blank Taharez look tooltip text causes a crash.
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.
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.
If somebody helps you by replying to your thread, upvote him/her as a thanks! Make sure to include your CEGUI.log and everything you tried when posting! And remember that we are not magicians!
Re: Blank Taharez look tooltip text causes a crash.
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.
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.
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.
If somebody helps you by replying to your thread, upvote him/her as a thanks! Make sure to include your CEGUI.log and everything you tried when posting! And remember that we are not magicians!
Re: Blank Taharez look tooltip text causes a crash.
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.
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.
"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.
If somebody helps you by replying to your thread, upvote him/her as a thanks! Make sure to include your CEGUI.log and everything you tried when posting! And remember that we are not magicians!
Re: Blank Taharez look tooltip text causes a crash.
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.
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.
If somebody helps you by replying to your thread, upvote him/her as a thanks! Make sure to include your CEGUI.log and everything you tried when posting! And remember that we are not magicians!
Who is online
Users browsing this forum: No registered users and 14 guests