am 6aed6077: Merge "Fix unnecessary call to __strncpy_chk2"

* commit '6aed6077fbe2b2039ab9160fb1e33ffe07907f32':
  Fix unnecessary call to __strncpy_chk2
This commit is contained in:
Nick Kralevich 2013-09-27 15:15:31 -07:00 committed by Android Git Automerger
commit f56e0e4b5e

View File

@ -135,6 +135,10 @@ char* strncpy(char* __restrict dest, const char* __restrict src, size_t n) {
return __builtin___strncpy_chk(dest, src, n, bos_dest);
}
if (__builtin_constant_p(n) && (n <= bos_src)) {
return __builtin___strncpy_chk(dest, src, n, bos_dest);
}
size_t slen = __builtin_strlen(src);
if (__builtin_constant_p(slen)) {
return __builtin___strncpy_chk(dest, src, n, bos_dest);