vgabios: Use vgamode_s instead of video_param_table in code.
[seabios.git] / src / util.c
index f9a75333d7376bb4cd5488cf40c4e9431f438246..ed73d632f11e619d1e83fbba7d7c581f82adc481 100644 (file)
@@ -262,6 +262,25 @@ strtcpy(char *dest, const char *src, size_t len)
     return dest;
 }
 
+// locate first occurance of character c in the string s
+char *
+strchr(const char *s, int c)
+{
+    for (; *s; s++)
+        if (*s == c)
+            return (char*)s;
+    return NULL;
+}
+
+// Remove any trailing blank characters (spaces, new lines, carriage returns)
+void
+nullTrailingSpace(char *buf)
+{
+    int len = strlen(buf);
+    char *end = &buf[len-1];
+    while (end >= buf && *end <= ' ')
+        *(end--) = '\0';
+}
 
 /****************************************************************
  * Keyboard calls