trio_class_t* self, TRIO_CONST char* string,
trio_flags_t flags, int width, int precision)
{
- int length;
+ int length = 0;
int ch;
assert(VALID(self));
}
else
{
- if (precision == 0)
+ if (precision <= 0)
{
length = trio_length(string);
}
}
/* Bail out if namespace is too long */
- if (trio_length(name) >= MAX_USER_NAME)
+ if (trio_length_max(name, MAX_USER_NAME) >= MAX_USER_NAME)
return NULL;
/* Bail out if namespace already is registered */
#include <assert.h>
#include <stdlib.h>
#include <string.h>
+#include <limits.h>
#include <ctype.h>
#include "triodef.h"
#include "triostr.h"
TRIO_PUBLIC_STRING size_t trio_length TRIO_ARGS1((string), TRIO_CONST char* string)
{
- return strlen(string);
+ return trio_length_max(string, INT_MAX);
}
#endif