mirror of
https://github.com/MidnightCommander/mc
synced 2024-12-22 20:36:50 +03:00
* slang/slmisc.c: Import SLmake_string() and SLmake_nstring().
This commit is contained in:
parent
199cc08828
commit
71268714c0
@ -1,3 +1,7 @@
|
||||
2006-02-20 Pavel Tsekov <ptsekov@gmx.net>
|
||||
|
||||
* slmisc.c: Import SLmake_string() and SLmake_nstring().
|
||||
|
||||
2006-02-15 Leonard den Ottolander <leonard den ottolander nl>
|
||||
|
||||
* slcommon.c: Patch to slang-2.0.6 leaving local patches intact.
|
||||
|
@ -29,6 +29,25 @@ USA.
|
||||
#include "slang.h"
|
||||
#include "_slang.h"
|
||||
|
||||
|
||||
char *SLmake_string(char *str)
|
||||
{
|
||||
return SLmake_nstring(str, strlen (str));
|
||||
}
|
||||
|
||||
char *SLmake_nstring (char *str, unsigned int n)
|
||||
{
|
||||
char *ptr;
|
||||
|
||||
if (NULL == (ptr = SLmalloc(n + 1)))
|
||||
{
|
||||
return NULL;
|
||||
}
|
||||
SLMEMCPY (ptr, str, n);
|
||||
ptr[n] = 0;
|
||||
return(ptr);
|
||||
}
|
||||
|
||||
/*
|
||||
* This function assumes that the initial \ char has been removed.
|
||||
*/
|
||||
|
Loading…
Reference in New Issue
Block a user