aboutsummaryrefslogtreecommitdiff
path: root/src/docker.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/docker.c')
-rw-r--r--src/docker.c12
1 files changed, 12 insertions, 0 deletions
diff --git a/src/docker.c b/src/docker.c
index d5cffd9..e2a392b 100644
--- a/src/docker.c
+++ b/src/docker.c
@@ -168,3 +168,15 @@ int docker_capable(struct DockerCapabilities *result) {
result->usable = true;
return true;
}
+
+void docker_sanitize_tag(char *str) {
+ char *pos = str;
+ while (*pos != 0) {
+ if (!isalnum(*pos)) {
+ if (*pos != '.' && *pos != ':' && *pos != '/') {
+ *pos = '-';
+ }
+ }
+ pos++;
+ }
+}