Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
cosmetics from patch review
[simgrid.git] / src / xbt / xbt_str.c
index 7cb36fe..551aa99 100644 (file)
@@ -416,9 +416,9 @@ char *xbt_str_join(xbt_dynar_t dyn, const char *sep)
   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;
 }
@@ -449,9 +449,9 @@ char *xbt_str_join_array(const char *const *strs, const char *sep)
   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;
@@ -478,8 +478,8 @@ char *xbt_str_from_file(FILE * file)
 
 /** @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)
 {
@@ -496,8 +496,8 @@ 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)
 {