#include "xbt/sysdep.h"
#include "xbt/str.h" /* headers of these functions */
#include "xbt/strbuff.h"
-#include "xbt/matrix.h" /* for the diff */
/** @brief Strip whitespace (or other characters) from the end of a string.
*
p = res;
xbt_dynar_foreach(dyn, cpt, cursor) {
if ((int) cpt < dyn_len - 1)
- p += sprintf(p, "%s%s", cursor, sep);
+ p += snprintf(p,len, "%s%s", cursor, sep);
else
- p += sprintf(p, "%s", cursor);
+ p += snprintf(p,len, "%s", cursor);
}
return res;
}
q = res = xbt_malloc(len);
for (i=0;strs[i];i++) {
if (i!=0) { // not first loop
- q += sprintf(q, "%s%s", sep, strs[i]);
+ q += snprintf(q,len, "%s%s", sep, strs[i]);
} else {
- q += sprintf(q,"%s",strs[i]);
+ q += snprintf(q,len, "%s",strs[i]);
}
}
return res;
/** @brief Parse an integer out of a string, or raise an error
*
- * The #str is passed as argument to your #error_msg, as follows:
- * THROWF(arg_error, 0, error_msg, str);
+ * The @a str is passed as argument to your @a error_msg, as follows:
+ * @verbatim THROWF(arg_error, 0, error_msg, str); @endverbatim
*/
long int xbt_str_parse_int(const char* str, const char* error_msg)
{
/** @brief Parse a double out of a string, or raise an error
*
- * The #str is passed as argument to your #error_msg, as follows:
- * THROWF(arg_error, 0, error_msg, str);
+ * The @a str is passed as argument to your @a error_msg, as follows:
+ * @verbatim THROWF(arg_error, 0, error_msg, str); @endverbatim
*/
double xbt_str_parse_double(const char* str, const char* error_msg)
{