mirror of
https://github.com/rfivet/uemacs.git
synced 2025-11-23 11:41:15 -05:00
Bindable functions take a boolean as flag.
Emphasize which one always return TRUE. Use mloutfail() to introduce consistency when a function fails with error message.
This commit is contained in:
25
util.c
25
util.c
@@ -1,17 +1,20 @@
|
||||
/* 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)
|
||||
return;
|
||||
while (--size) {
|
||||
char c = *src++;
|
||||
if (!c)
|
||||
break;
|
||||
*dst++ = c;
|
||||
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;
|
||||
|
||||
*dst = 0 ;
|
||||
}
|
||||
|
||||
|
||||
/* end of util.c */
|
||||
|
||||
Reference in New Issue
Block a user