qemacs-commit
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Qemacs-commit] qemacs cutils.c cutils.h


From: Charlie Gordon
Subject: [Qemacs-commit] qemacs cutils.c cutils.h
Date: Tue, 03 Dec 2013 17:31:49 +0000

CVSROOT:        /sources/qemacs
Module name:    qemacs
Changes by:     Charlie Gordon <chqrlie>        13/12/03 17:31:49

Modified files:
        .              : cutils.c cutils.h 

Log message:
        make pstrcpy return destination buffer

CVSWeb URLs:
http://cvs.savannah.gnu.org/viewcvs/qemacs/cutils.c?cvsroot=qemacs&r1=1.15&r2=1.16
http://cvs.savannah.gnu.org/viewcvs/qemacs/cutils.h?cvsroot=qemacs&r1=1.13&r2=1.14

Patches:
Index: cutils.c
===================================================================
RCS file: /sources/qemacs/qemacs/cutils.c,v
retrieving revision 1.15
retrieving revision 1.16
diff -u -b -r1.15 -r1.16
--- cutils.c    22 Apr 2008 08:11:55 -0000      1.15
+++ cutils.c    3 Dec 2013 17:31:49 -0000       1.16
@@ -63,13 +63,13 @@
  * @param buf_size size of destination buffer
  * @param str source string
  */
-void pstrcpy(char *buf, int buf_size, const char *str)
+char *pstrcpy(char *buf, int buf_size, const char *str)
 {
     int c;
     char *q = buf;
 
     if (buf_size <= 0)
-        return;
+        return buf;
 
     for (;;) {
         c = *str++;
@@ -78,6 +78,7 @@
         *q++ = c;
     }
     *q = '\0';
+    return buf;
 }
 
 /* strcat and truncate. */

Index: cutils.h
===================================================================
RCS file: /sources/qemacs/qemacs/cutils.h,v
retrieving revision 1.13
retrieving revision 1.14
diff -u -b -r1.13 -r1.14
--- cutils.h    22 Apr 2008 08:11:56 -0000      1.13
+++ cutils.h    3 Dec 2013 17:31:49 -0000       1.14
@@ -31,7 +31,7 @@
 #define pstrncpy(buf, sz, str, n)  qe_pstrncpy(buf, sz, str, n)
 
 int strstart(const char *str, const char *val, const char **ptr);
-void pstrcpy(char *buf, int buf_size, const char *str);
+char *pstrcpy(char *buf, int buf_size, const char *str);
 char *pstrcat(char *buf, int buf_size, const char *s);
 char *pstrncpy(char *buf, int buf_size, const char *s, int len);
 const char *get_basename(const char *filename);



reply via email to

[Prev in Thread] Current Thread [Next in Thread]