mirror of
https://git.code.sf.net/p/quake/newtree
synced 2025-05-30 08:40:39 +00:00
char *buf; strn.* (..., sizeof(buf) ...) doesn't work so well :/
This commit is contained in:
parent
eae11661e4
commit
b34504057c
5 changed files with 12 additions and 10 deletions
|
@ -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);
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue