[prev in list] [next in list] [prev in thread] [next in thread] 

List:       licq-main
Subject:    Re: [Licq-main] UIN problem
From:       Tani Hosokawa <unknown () riverstyx ! net>
Date:       2000-03-25 18:14:34
[Download RAW message or body]

I might be wrong about this, but:

--- cut ---
ulong QString::toULong ( bool * ok=0, int base=10 ) const
Returns the string converted to an unsigned long value. 

If ok is non-null, *ok is set to TRUE if there are no conceivable errors, and FALSE \
                if the string is not a number at all, or if it has trailing garbage. 
--- cut ---

If you don't pass it a pointer, isn't the behavour going to be undefined?
It appears to work in other places, but not here?  There are other
instances of toULong being called without a parameter, but I thought
I'd toss this out before wasting any time changing them.  I don't have
any other users to register, nor do I want to, so this isn't tested...

BTW, this is against the licq-000324 CVS snapshot.

--- ../../../../licq-000324/plugins/qt-gui/src/registeruser.cpp Thu Mar 23 19:18:34 \
                2000
+++ registeruser.cpp    Sat Mar 25 10:09:46 2000
@@ -114,9 +114,9 @@
 
   if (chkExistingUser->isChecked())
   {
-    unsigned long nUin = nfoUin->text().toULong();
+    unsigned long nUin = nfoUin->text().toULong(&toULong_ok);
     // Validate uin
-    if (nUin == 0)
+    if (!toULong_ok || !nUin)
     {
       InformUser (this, tr("Invalid UIN.  Try again."));
       return;
--- ../../../../licq-000324/plugins/qt-gui/src/registeruser.h   Mon Jan 10 14:53:31 \
                2000
+++ registeruser.h      Sat Mar 25 10:04:55 2000
@@ -16,7 +16,8 @@
   Q_OBJECT
 public:
   RegisterUserDlg (CICQDaemon *s, QWidget *parent = 0, const char *name = 0 );
-
+private:
+  bool toULong_ok;
 signals:
   void signal_done();
 

On Sat, Mar 25, 2000 at 09:25:57AM -0800, George Schoelles wrote:
> -----BEGIN PGP SIGNED MESSAGE-----
> 
> I installed LICQ this morning for the first time and received an "Invalid
> UIN" when I went to register.  I could not fix this through the user
> interface in a normal way.
> 
> My fix was to create a new UIN, than to edit the configuration file with
> the data I wanted.  Thank god it was in plain english.
> 
> Works great now.
> 
> George
> 
> 
> 
> *             *             *  ===========
> Thawte authorized WOT Notary   ICQ: 122492
> *             *             *  ===========
> 
> Nisi Defectum Haud Reficindium  (If it ain't broke, don't fix it)
> 
> Digitally signed with PGP to allow source and content authentication by
> recipient.
> 
> http://www.chefsparts.com http://www.chefsservice.com
> http://www.chefsequipment.com
> -----BEGIN PGP SIGNATURE-----
> Version: GnuPG v1.0.1 (GNU/Linux)
> Comment: pgpenvelope - http://www.uiuc.edu/ph/www/ftobin/resources.html
> 
> iQEVAwUBONz2r/7EcYXHdx0TAQEq+wf/f5WNmR90+tmAWcX4B5HdI0uynhrNWfzI
> GYuXK4kmkFR/KkGPjIJ3f3tJjJHKngeixL0wDAnfRy09XxXmV+RrhDGSJnUsnX9V
> KiWtLlHtMF9c5au126Nsvw3wNEzGtqFWqMdFWI3zTq5R9XK4vX/efW52T79jAGY+
> UQOp2eZ+xU3nSCcYVp/K8K+u6F1JDA0J914aEq7zhbCht/ZwutbmBdtQK44NSTAQ
> rIFtgP7UV9uzyOycQ//hMcfA02Pq0+HNcsCvphwySoEgmGnSDC/1lgAG1GBaSExU
> 6SCCQxAi33fsjFVQOH6Iipom3kqnPyG3KIdRvpXqJ4rWpyuVoS827Q==
> =IQS+
> -----END PGP SIGNATURE-----
> 
> 
> _______________________________________________
> Licq-main mailing list
> Licq-main@licq.org
> http://lists.sourceforge.net/mailman/listinfo/licq-main

-- 
---
tani hosokawa
river styx internet


[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic