CVS: rdesktop proto.h,1.79,1.80 rdesktop.c,1.134,1.135 rdpsnd_oss.c,1.17,1.18 rdpsnd_sun.c,1.15,1.16 xkeymap.c,1.83,1.84
Peter Åstrand <[email protected]>
| Newsgroups | gmane.network.rdesktop.cvs |
|---|---|
| Message-ID | <[email protected]> |
Update of /cvsroot/rdesktop/rdesktop
In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv917
Modified Files:
proto.h rdesktop.c rdpsnd_oss.c rdpsnd_sun.c xkeymap.c
Log Message:
Created a common xstrdup function.
Index: proto.h
===================================================================
RCS file: /cvsroot/rdesktop/rdesktop/proto.h,v
retrieving revision 1.79
retrieving revision 1.80
diff -C2 -d -r1.79 -r1.80
*** proto.h 4 Aug 2005 12:44:10 -0000 1.79
--- proto.h 4 Aug 2005 12:50:15 -0000 1.80
***************
*** 78,81 ****
--- 78,82 ----
void generate_random(uint8 * random);
void *xmalloc(int size);
+ char *xstrdup(const char *s);
void *xrealloc(void *oldmem, int size);
void xfree(void *mem);
Index: rdesktop.c
===================================================================
RCS file: /cvsroot/rdesktop/rdesktop/rdesktop.c,v
retrieving revision 1.134
retrieving revision 1.135
diff -C2 -d -r1.134 -r1.135
*** rdesktop.c 4 Aug 2005 12:44:10 -0000 1.134
--- rdesktop.c 4 Aug 2005 12:50:15 -0000 1.135
***************
*** 383,392 ****
if (locale)
{
! locale = strdup(locale);
! if (locale == NULL)
! {
! perror("strdup");
! exit(1);
! }
}
--- 383,387 ----
if (locale)
{
! locale = xstrdup(locale);
}
***************
*** 942,945 ****
--- 937,953 ----
}
+ /* strdup */
+ char *
+ xstrdup(const char *s)
+ {
+ char *mem = strdup(s);
+ if (mem == NULL)
+ {
+ perror("strdup");
+ exit(1);
+ }
+ return mem;
+ }
+
/* realloc; exit if out of memory */
void *
Index: rdpsnd_oss.c
===================================================================
RCS file: /cvsroot/rdesktop/rdesktop/rdpsnd_oss.c,v
retrieving revision 1.17
retrieving revision 1.18
diff -C2 -d -r1.17 -r1.18
*** rdpsnd_oss.c 3 Aug 2005 10:56:16 -0000 1.17
--- rdpsnd_oss.c 4 Aug 2005 12:50:15 -0000 1.18
***************
*** 51,55 ****
if (dsp_dev == NULL)
{
! dsp_dev = strdup("/dev/dsp");
}
--- 51,55 ----
if (dsp_dev == NULL)
{
! dsp_dev = xstrdup("/dev/dsp");
}
Index: rdpsnd_sun.c
===================================================================
RCS file: /cvsroot/rdesktop/rdesktop/rdpsnd_sun.c,v
retrieving revision 1.15
retrieving revision 1.16
diff -C2 -d -r1.15 -r1.16
*** rdpsnd_sun.c 3 Aug 2005 10:56:16 -0000 1.15
--- rdpsnd_sun.c 4 Aug 2005 12:50:15 -0000 1.16
***************
*** 55,59 ****
if (dsp_dev == NULL)
{
! dsp_dev = strdup("/dev/audio");
}
--- 55,59 ----
if (dsp_dev == NULL)
{
! dsp_dev = xstrdup("/dev/audio");
}
Index: xkeymap.c
===================================================================
RCS file: /cvsroot/rdesktop/rdesktop/xkeymap.c,v
retrieving revision 1.83
retrieving revision 1.84
diff -C2 -d -r1.83 -r1.84
*** xkeymap.c 4 Aug 2005 12:44:10 -0000 1.83
--- xkeymap.c 4 Aug 2005 12:50:15 -0000 1.84
***************
*** 167,176 ****
/* Create a working copy */
! str = strdup(locale);
! if (str == NULL)
! {
! perror("strdup");
! exit(1);
! }
/* Truncate at dot and at */
--- 167,171 ----
/* Create a working copy */
! str = xstrdup(locale);
/* Truncate at dot and at */
-------------------------------------------------------
SF.Net email is Sponsored by the Better Software Conference & EXPO
September 19-22, 2005 * San Francisco, CA * Development Lifecycle Practices
Agile & Plan-Driven Development * Managing Projects & Teams * Testing & QA
Security * Process Improvement & Measurement * http://www.sqe.com/bsce5sf