ViewVC Help
View File | Revision Log | Show Annotations | Download File
/cvs/deliantra/server/common/utils.C
(Generate patch)

Comparing deliantra/server/common/utils.C (file contents):
Revision 1.12 by root, Tue Sep 12 20:55:40 2006 UTC vs.
Revision 1.14 by root, Thu Sep 14 01:34:41 2006 UTC

1
2/*
3 * static char *rcsid_utils_c =
4 * "$Id: utils.C,v 1.12 2006/09/12 20:55:40 root Exp $";
5 */
6
7/* 1/*
8 CrossFire, A Multiplayer game for X-windows 2 CrossFire, A Multiplayer game for X-windows
9 3
10 Copyright (C) 2002 Mark Wedel & Crossfire Development Team 4 Copyright (C) 2002 Mark Wedel & Crossfire Development Team
11 Copyright (C) 1992 Frank Tore Johansen 5 Copyright (C) 1992 Frank Tore Johansen
549 strcpy (input, tmp); 543 strcpy (input, tmp);
550 544
551 return; 545 return;
552} 546}
553 547
548/////////////////////////////////////////////////////////////////////////////
549
554void *alloc (int s) throw (std::bad_alloc) 550void *alloc (int s) throw (std::bad_alloc)
555{ 551{
552 void *p = g_slice_alloc (s);
553
556 if (s) 554 if (!p)
557 return g_slice_alloc (s); 555 throw std::bad_alloc ();
558 else 556
559 return 0; 557 return p;
560}
561
562void dealloc (void *p, int s) throw ()
563{
564 if (s)
565 g_slice_free1 (s, p);
566} 558}
567 559
568void assign (char *dst, const char *src, int maxlen) 560void assign (char *dst, const char *src, int maxlen)
569{ 561{
570 if (!src) 562 if (!src)

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines