|
From: | S11001001 |
Subject: | Re: [DotGNU]Uri.cs : silly bugs ... |
Date: | Sat, 14 Sep 2002 02:03:30 -0500 |
User-agent: | Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.2a) Gecko/20020913 |
Gopal V wrote:
Uri.cs : 724private UriAuthority ParseAuthority(String authority) { UriAuthority retval; int interimpos1=0, interimpos2=0; interimpos1 = authority.IndexOf('@'); if (interimpos1 > 0) // there is userinfo { retval.userinfo = authority.Substring(0, interimpos1 - 1); Using without initializing ? (I did get a NullReferenceException here ...)
Jeez...who knew, that one day we would have to initialize stack variables with the new keyword! I just assumed C behavior, silly me.
Something I really miss from C++: automatic default constructors if you don't specify a constructor....
Also the function has no return statement ... please add a correct return statement (I would have added it , if I knew what that code did ;-)
Oops...when I changed that to an independent function from one that directly modified the values, I forgot the part about it not being void anymore.
-- Stephen Compall DotGNU `Contributor' -- http://dotgnu.org GNU does not eliminate all the world's problems, only some of them. -- RMS, "GNU Manifesto"
[Prev in Thread] | Current Thread | [Next in Thread] |