/[gxemul]/trunk/src/misc.c
This is repository of my old source code which isn't updated any more. Go to git.rot13.org for current projects!
ViewVC logotype

Diff of /trunk/src/misc.c

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 9 by dpavlin, Mon Oct 8 16:18:11 2007 UTC revision 10 by dpavlin, Mon Oct 8 16:18:27 2007 UTC
# Line 25  Line 25 
25   *  SUCH DAMAGE.   *  SUCH DAMAGE.
26   *   *
27   *   *
28   *  $Id: misc.c,v 1.2 2005/05/07 02:13:29 debug Exp $   *  $Id: misc.c,v 1.3 2005/06/20 05:52:47 debug Exp $
29   */   */
30    
31  #include <stdio.h>  #include <stdio.h>
32  #include <stdlib.h>  #include <stdlib.h>
33    #include <string.h>
34  #include <fcntl.h>  #include <fcntl.h>
35    
36  #include "misc.h"  #include "misc.h"
# Line 123  int mymkstemp(char *template) Line 124  int mymkstemp(char *template)
124          return h;          return h;
125  }  }
126    
127    
128    #ifdef USE_STRLCPY_REPLACEMENTS
129    /*
130     *  mystrlcpy():
131     *
132     *  Quick hack strlcpy() replacement for systems that lack that function.
133     *  NOTE: No length checking is done.
134     */
135    size_t mystrlcpy(char *dst, const char *src, size_t size)
136    {
137            strcpy(dst, src);
138            return strlen(src);
139    }
140    
141    
142    /*
143     *  mystrlcat():
144     *
145     *  Quick hack strlcat() replacement for systems that lack that function.
146     *  NOTE: No length checking is done.
147     */
148    size_t mystrlcat(char *dst, const char *src, size_t size)
149    {
150            size_t orig_dst_len = strlen(dst);
151            strcat(dst, src);
152            return strlen(src) + orig_dst_len;
153    }
154    #endif
155    

Legend:
Removed from v.9  
changed lines
  Added in v.10

  ViewVC Help
Powered by ViewVC 1.1.26