summaryrefslogtreecommitdiffhomepage
path: root/examples
diff options
context:
space:
mode:
authorTyge Løvset <[email protected]>2022-01-16 17:46:56 +0100
committerTyge Løvset <[email protected]>2022-01-16 18:07:31 +0100
commit7ab5c49a47de856ea58a979cdc086ea22d8eceff (patch)
tree97418fa06cd6e5bd286b70269aec80ece0261b04 /examples
parent5bd8089e0c3c0a4f48c40d7011d30132c921408a (diff)
downloadSTC-modified-7ab5c49a47de856ea58a979cdc086ea22d8eceff.tar.gz
STC-modified-7ab5c49a47de856ea58a979cdc086ea22d8eceff.zip
Made private functions (not called by header inlines) always static. Added required param tp examples/regex1.c.
Diffstat (limited to 'examples')
-rw-r--r--examples/regex1.c8
1 files changed, 6 insertions, 2 deletions
diff --git a/examples/regex1.c b/examples/regex1.c
index 7385d69e..e24e5400 100644
--- a/examples/regex1.c
+++ b/examples/regex1.c
@@ -1,8 +1,12 @@
#include <stc/cstr.h>
#include <stc/cregex.h>
-int main()
+int main(int argc, char* argv[])
{
+ if (argc <= 1) {
+ printf("Usage: regex1 -i\n");
+ return 0;
+ }
c_auto (cstr, input)
c_auto (cregex, float_expr)
{
@@ -10,7 +14,7 @@ int main()
// Until "q" is given, ask for another number
while (true)
{
- printf("Enter float number (q for quit): ");
+ printf("Enter a double precision number (q for quit): ");
cstr_getline(&input, stdin);
// Exit when the user inputs q