+/** @brief Check that an action name is valid
+ * @param name Action
+ * @return 1 if valid, 0 if not
+ */
+static int dcgi_valid_action(const char *name) {
+ int c;
+
+ /* First character must be letter or digit (this also requires there to _be_
+ * a first character) */
+ if(!isalnum((unsigned char)*name))
+ return 0;
+ /* Only letters, digits, '.' and '-' allowed */
+ while((c = (unsigned char)*name++)) {
+ if(!(isalnum(c)
+ || c == '.'
+ || c == '_'))
+ return 0;
+ }
+ return 1;
+}
+