char *buf; strn.* (..., sizeof(buf) ...) doesn't work so well :/

This commit is contained in:
Bill Currie 2000-12-05 16:41:28 +00:00
parent eae11661e4
commit b34504057c
5 changed files with 12 additions and 10 deletions

View file

@ -31,12 +31,12 @@
#ifdef HAVE_CONFIG_H
# include <config.h>
#endif
#ifdef HAVE_MALLOC_H
# include <malloc.h>
#endif
#include <stdarg.h>
#include <stdlib.h>
#include <quakeio.h>
#include <string.h>
#ifdef WIN32
# include <io.h>
@ -47,12 +47,14 @@
#ifdef HAVE_UNISTD_H
# include <unistd.h>
#endif
#ifdef _MSC_VER
# define _POSIX_
#endif
#include <limits.h>
#include "quakeio.h"
#include "quakefs.h"
#ifdef WIN32
#ifndef __BORLANDC__
# define setmode _setmode
@ -82,7 +84,7 @@ Qexpand_squiggle(const char *path, char *dest)
if (home) {
strcpy (dest, home);
strncat (dest, path+1, sizeof(dest) - strlen (dest)); // skip leading ~
strncat (dest, path+1, MAX_OSPATH - strlen (dest)); // skip leading ~
} else
strcpy (dest,path);
}