mirror of
https://github.com/rfivet/uemacs.git
synced 2024-11-14 00:26:01 -05:00
Renaud Fivet
50b727bf7f
Emphasize which one always return TRUE. Use mloutfail() to introduce consistency when a function fails with error message.
21 lines
300 B
C
21 lines
300 B
C
/* util.c -- implements util.h */
|
|
#include "util.h"
|
|
|
|
/* Safe zeroing, no complaining about overlap */
|
|
void mystrscpy( char *dst, const char *src, int size) {
|
|
if( size <= 0)
|
|
return ;
|
|
|
|
while( --size) {
|
|
char c = *src++ ;
|
|
if( !c)
|
|
break ;
|
|
|
|
*dst++ = c ;
|
|
}
|
|
|
|
*dst = 0 ;
|
|
}
|
|
|
|
/* end of util.c */
|