1. Engage brain. 2. Write macro. Previous commit attempted to perform

2 before 1.
This commit is contained in:
Jordan K. Hubbard 1996-12-17 00:00:15 +00:00
parent 60757ce6ee
commit 3cce01a416
6 changed files with 12 additions and 12 deletions

View File

@ -1,7 +1,7 @@
/*
* Miscellaneous support routines..
*
* $Id: misc.c,v 1.24 1996/12/11 18:23:18 jkh Exp $
* $Id: misc.c,v 1.25 1996/12/12 22:38:41 jkh Exp $
*
* Copyright (c) 1995
* Jordan Hubbard. All rights reserved.
@ -80,7 +80,7 @@ string_concat(char *one, char *two)
char *
sstrncpy(char *dst, const char *src, int size)
{
dst[--size] = '\0';
dst[size] = '\0';
return strncpy(dst, src, size);
}

View File

@ -4,7 +4,7 @@
* This is probably the last attempt in the `sysinstall' line, the next
* generation being slated to essentially a complete rewrite.
*
* $Id: sysinstall.h,v 1.93 1996/12/12 08:33:38 jkh Exp $
* $Id: sysinstall.h,v 1.94 1996/12/14 23:09:07 jkh Exp $
*
* Copyright (c) 1995
* Jordan Hubbard. All rights reserved.
@ -144,7 +144,7 @@
#define ATTR_TITLE button_active_attr
/* Handy strncpy() macro */
#define SAFE_STRCPY(to, from) sstrncpy((to), (from), sizeof (to))
#define SAFE_STRCPY(to, from) sstrncpy((to), (from), sizeof (to) - 1)
/*** Types ***/
typedef unsigned int Boolean;

View File

@ -1,7 +1,7 @@
/*
* Miscellaneous support routines..
*
* $Id: misc.c,v 1.24 1996/12/11 18:23:18 jkh Exp $
* $Id: misc.c,v 1.25 1996/12/12 22:38:41 jkh Exp $
*
* Copyright (c) 1995
* Jordan Hubbard. All rights reserved.
@ -80,7 +80,7 @@ string_concat(char *one, char *two)
char *
sstrncpy(char *dst, const char *src, int size)
{
dst[--size] = '\0';
dst[size] = '\0';
return strncpy(dst, src, size);
}

View File

@ -4,7 +4,7 @@
* This is probably the last attempt in the `sysinstall' line, the next
* generation being slated to essentially a complete rewrite.
*
* $Id: sysinstall.h,v 1.93 1996/12/12 08:33:38 jkh Exp $
* $Id: sysinstall.h,v 1.94 1996/12/14 23:09:07 jkh Exp $
*
* Copyright (c) 1995
* Jordan Hubbard. All rights reserved.
@ -144,7 +144,7 @@
#define ATTR_TITLE button_active_attr
/* Handy strncpy() macro */
#define SAFE_STRCPY(to, from) sstrncpy((to), (from), sizeof (to))
#define SAFE_STRCPY(to, from) sstrncpy((to), (from), sizeof (to) - 1)
/*** Types ***/
typedef unsigned int Boolean;

View File

@ -1,7 +1,7 @@
/*
* Miscellaneous support routines..
*
* $Id: misc.c,v 1.24 1996/12/11 18:23:18 jkh Exp $
* $Id: misc.c,v 1.25 1996/12/12 22:38:41 jkh Exp $
*
* Copyright (c) 1995
* Jordan Hubbard. All rights reserved.
@ -80,7 +80,7 @@ string_concat(char *one, char *two)
char *
sstrncpy(char *dst, const char *src, int size)
{
dst[--size] = '\0';
dst[size] = '\0';
return strncpy(dst, src, size);
}

View File

@ -4,7 +4,7 @@
* This is probably the last attempt in the `sysinstall' line, the next
* generation being slated to essentially a complete rewrite.
*
* $Id: sysinstall.h,v 1.93 1996/12/12 08:33:38 jkh Exp $
* $Id: sysinstall.h,v 1.94 1996/12/14 23:09:07 jkh Exp $
*
* Copyright (c) 1995
* Jordan Hubbard. All rights reserved.
@ -144,7 +144,7 @@
#define ATTR_TITLE button_active_attr
/* Handy strncpy() macro */
#define SAFE_STRCPY(to, from) sstrncpy((to), (from), sizeof (to))
#define SAFE_STRCPY(to, from) sstrncpy((to), (from), sizeof (to) - 1)
/*** Types ***/
typedef unsigned int Boolean;