aboutsummaryrefslogtreecommitdiffstats
path: root/phpBB/develop/fix_files.sh
diff options
context:
space:
mode:
authorJakub Senko <senky@users.noreply.github.com>2018-09-10 20:14:36 +0200
committerJakub Senko <jakubsenko@gmail.com>2018-09-15 12:51:32 +0200
commitc38075d2c27d5a727ad9bf31e2a2443563bf3eec (patch)
tree6d3aa135abb7a0b73621534e9595367094b9f2ca /phpBB/develop/fix_files.sh
parent088907fe8e18f87f7af3098041ac031501aa1f7f (diff)
downloadforums-c38075d2c27d5a727ad9bf31e2a2443563bf3eec.tar
forums-c38075d2c27d5a727ad9bf31e2a2443563bf3eec.tar.gz
forums-c38075d2c27d5a727ad9bf31e2a2443563bf3eec.tar.bz2
forums-c38075d2c27d5a727ad9bf31e2a2443563bf3eec.tar.xz
forums-c38075d2c27d5a727ad9bf31e2a2443563bf3eec.zip
[ticket/15768] Add a license to a repository
PHPBB3-15768
Diffstat (limited to 'phpBB/develop/fix_files.sh')
0 files changed, 0 insertions, 0 deletions
='n31' href='#n31'>31
#include "dietfeatures.h"
#include <string.h>

#ifdef WANT_NON_COMPLIANT_STRNCAT
/* this implementation is not standards compliant.
 * the standard says that strncat(dest,"foobar",3) should write 'f', 'o'
 * and 'o'.  The programmer is then expected to overwrite the last byte
 * with '\0', which is often forgotten.  This implementation makes sure
 * the last written bytes is always '\0'. */
#endif

char *strncat(char *s, const char *t, size_t n) {
  char *dest=s;
  register char *max;
  s+=strlen(s);
#ifdef WANT_NON_COMPLIANT_STRNCAT
  max=s+n-1;
#else
  max=s+n;
#endif
  for (;;) {
    if (!(*s = *t)) break; if (++s==max) break; ++t;
#ifndef WANT_SMALL_STRING_ROUTINES
    if (!(*s = *t)) break; if (++s==max) break; ++t;
    if (!(*s = *t)) break; if (++s==max) break; ++t;
    if (!(*s = *t)) break; if (++s==max) break; ++t;
#endif
  }
  *s=0;
  return dest;
}