summaryrefslogtreecommitdiff
path: root/src/common/extstr.c
diff options
context:
space:
mode:
authorCyrille Bagard <nocbos@gmail.com>2012-10-17 21:04:36 (GMT)
committerCyrille Bagard <nocbos@gmail.com>2012-10-17 21:04:36 (GMT)
commited846003946a44588c7c131b9c9001f97bf10711 (patch)
tree4385e199d1a42507067521eaf5d98718229133a8 /src/common/extstr.c
parentf08d214e1b13bd56e0305e2e4ae511f6f7514195 (diff)
Updated panels captions again.
git-svn-id: svn://svn.gna.org/svn/chrysalide/trunk@271 abbe820e-26c8-41b2-8c08-b7b2b41f8b0a
Diffstat (limited to 'src/common/extstr.c')
-rw-r--r--src/common/extstr.c32
1 files changed, 32 insertions, 0 deletions
diff --git a/src/common/extstr.c b/src/common/extstr.c
index 4dec066..17cffec 100644
--- a/src/common/extstr.c
+++ b/src/common/extstr.c
@@ -272,3 +272,35 @@ char *escape_crlf(char *input)
return input;
}
+
+
+/******************************************************************************
+* *
+* Paramètres : input = chaîne de caractères à traiter. *
+* max = taille maximale de chaîne acceptable. *
+* *
+* Description : Borne la taille d'une chaîne à une valeur donnée. *
+* *
+* Retour : Adresse de la chaîne de caractères ou input si pas besoin. *
+* *
+* Remarques : - *
+* *
+******************************************************************************/
+
+char *ellipsis(char *input, size_t max)
+{
+ char *result; /* Chaîne à retourner */
+
+ if (strlen(input) > max)
+ {
+ result = strndup(input, max);
+ result = stradd(result, "...");
+
+ free(input);
+
+ }
+ else result = input;
+
+ return result;
+
+}