src/stdlib/SDL_string.c
changeset 11052 0666dea591ab
parent 11049 6e24dc7c67c6
child 11227 10b07421903d
equal deleted inserted replaced
11051:241410389057 11052:0666dea591ab
   475     }
   475     }
   476     return srclen;
   476     return srclen;
   477 #endif /* HAVE_STRLCPY */
   477 #endif /* HAVE_STRLCPY */
   478 }
   478 }
   479 
   479 
   480 size_t SDL_utf8strlcpy(SDL_OUT_Z_CAP(dst_bytes) char *dst, const char *src, size_t dst_bytes)
   480 size_t
       
   481 SDL_utf8strlcpy(SDL_OUT_Z_CAP(dst_bytes) char *dst, const char *src, size_t dst_bytes)
   481 {
   482 {
   482     size_t src_bytes = SDL_strlen(src);
   483     size_t src_bytes = SDL_strlen(src);
   483     size_t bytes = SDL_min(src_bytes, dst_bytes - 1);
   484     size_t bytes = SDL_min(src_bytes, dst_bytes - 1);
   484     size_t i = 0;
   485     size_t i = 0;
   485     char trailing_bytes = 0;
   486     char trailing_bytes = 0;