|
7 | 7 | *
|
8 | 8 | * Copyright (c) 1994, Regents of the University of California
|
9 | 9 | *
|
10 |
| - * $Id: c.h,v 1.23 1997/10/2501:10:58 momjian Exp $ |
| 10 | + * $Id: c.h,v 1.24 1997/10/2502:14:22 momjian Exp $ |
11 | 11 | *
|
12 | 12 | *-------------------------------------------------------------------------
|
13 | 13 | */
|
@@ -690,11 +690,8 @@ typedef struct Exception
|
690 | 690 | *Does string copy, and forces terminating NULL
|
691 | 691 | */
|
692 | 692 | /* we do this so if the macro is used in an if action, it will work */
|
693 |
| -#defineStrNCpy(dst,src,len)do { \ |
694 |
| -strncpy((dst),(src),(len)); \ |
695 |
| -if (len > 0) \ |
696 |
| -*((dst)+(len)-1)='\0'; \ |
697 |
| -} while (0) |
| 693 | +#defineStrNCpy(dst,src,len)\ |
| 694 | +(strncpy((dst),(src),(len)),(len > 0) ? *((dst)+(len)-1)='\0' : NULL,(dst)) |
698 | 695 |
|
699 | 696 | /* Get a bit mask of the bits set in non-int32 aligned addresses */
|
700 | 697 | #defineINT_ALIGN_MASK (sizeof(int32) - 1)
|
|