Hi,

there goes another fix in the includes as I see :). The problem with this is that it makes the gtk2-gui (icqnd) very buggy, because something with the addresses changes (whatever - no idea what's exactly going on). Wouldn't it be possible to put the implementations of these short functions out of the .h files into the .cpp files where they belong (as it should be)? People always have to recompile icqnd to use it with devel-versions and I'm getting a lot of messages asking me why icqnd is so buggy (when they use the .deb I provided for 1.3.2).

Regards,
Joachim

[EMAIL PROTECTED] schrieb:
Author: erijo
Date: Tue Oct 17 18:35:55 2006
New Revision: 4709

URL: http://svn.licq.org/viewvc/licq?rev=4709&view=rev
Log:
Don't use asprintf as it's a GNU extension. Do it the "c++-way" with a 
stringstream instead.

Fixes #1415.

Modified:
    trunk/licq/include/licq_message.h

Modified: trunk/licq/include/licq_message.h
URL: 
http://svn.licq.org/viewvc/licq/trunk/licq/include/licq_message.h?rev=4709&r1=4708&r2=4709&view=diff
==============================================================================
--- trunk/licq/include/licq_message.h (original)
+++ trunk/licq/include/licq_message.h Tue Oct 17 18:35:55 2006
@@ -1,8 +1,9 @@
 #ifndef MESSAGE_H
 #define MESSAGE_H
+#include <ctime>
 #include <list>
-#include <time.h>
+#include <sstream>
#include "licq_buffer.h"
 #include "licq_constants.h"
@@ -393,10 +394,19 @@
 class CContact
 {
 public:
-  CContact(const char *s, unsigned long n, const char *a)
-    {  m_szId = strdup(s); m_nPPID = n; m_szAlias = strdup(a); m_nUin = 
strtoul(s, (char**)NULL, 10); }
-  CContact(unsigned long n, const char *a)
-    { asprintf(&m_szId, "%lu", n); m_nPPID = 0; m_nUin = n; m_szAlias = 
strdup(a); }
+  CContact(const char *s, unsigned long n, const char *a) : m_nPPID(n)
+  {
+    m_szId = strdup(s);
+    m_szAlias = strdup(a);
+    m_nUin = strtoul(s, (char**)NULL, 10);
+  }
+  CContact(unsigned long n, const char *a) : m_nUin(n), m_nPPID(0)
+  {
+    std::ostringstream ss;
+    ss << n;
+    m_szId = strdup(ss.str().c_str());
+    m_szAlias = strdup(a);
+  }
   ~CContact() { free(m_szAlias); free(m_szId); }
unsigned long Uin() { return m_nUin; }




Reply via email to