public/mms_sample_ext/stub_util.cpp
changeset 1990 de135d1f05b1
parent 1952 b7aa2b626807
     1.1 --- a/public/mms_sample_ext/stub_util.cpp	Fri Apr 11 08:04:11 2008 +0000
     1.2 +++ b/public/mms_sample_ext/stub_util.cpp	Fri Apr 11 17:16:36 2008 +0000
     1.3 @@ -1,22 +1,38 @@
     1.4 -#include <stdio.h>
     1.5 -#include <stdarg.h>
     1.6 -#include "stub_util.h"
     1.7 -
     1.8 -size_t UTIL_Format(char *buffer, size_t maxlength, const char *fmt, ...)
     1.9 -{
    1.10 -	va_list ap;
    1.11 -
    1.12 -	va_start(ap, fmt);
    1.13 -	size_t len = vsnprintf(buffer, maxlength, fmt, ap);
    1.14 -	va_end(ap);
    1.15 -
    1.16 -	if (len >= maxlength)
    1.17 -	{
    1.18 -		len = maxlength - 1;
    1.19 -		buffer[len] = '\0';
    1.20 -	}
    1.21 -
    1.22 -	return len;
    1.23 -}
    1.24 -
    1.25 -
    1.26 +/**
    1.27 + * vim: set ts=4 :
    1.28 + * ======================================================
    1.29 + * Metamod:Source Stub Plugin
    1.30 + * Written by AlliedModders LLC.
    1.31 + * ======================================================
    1.32 + *
    1.33 + * This software is provided 'as-is', without any express or implied warranty.
    1.34 + * In no event will the authors be held liable for any damages arising from 
    1.35 + * the use of this software.
    1.36 + *
    1.37 + * This stub plugin is public domain.
    1.38 + *
    1.39 + * Version: $Id$
    1.40 + */
    1.41 +
    1.42 +#include <stdio.h>
    1.43 +#include <stdarg.h>
    1.44 +#include "stub_util.h"
    1.45 +
    1.46 +size_t UTIL_Format(char *buffer, size_t maxlength, const char *fmt, ...)
    1.47 +{
    1.48 +	va_list ap;
    1.49 +
    1.50 +	va_start(ap, fmt);
    1.51 +	size_t len = vsnprintf(buffer, maxlength, fmt, ap);
    1.52 +	va_end(ap);
    1.53 +
    1.54 +	if (len >= maxlength)
    1.55 +	{
    1.56 +		len = maxlength - 1;
    1.57 +		buffer[len] = '\0';
    1.58 +	}
    1.59 +
    1.60 +	return len;
    1.61 +}
    1.62 +
    1.63 +