interplane.Get Omega
Read in your language

omega-harness

Agent skills for operating, encoding and communicating in Omega (.om) and the AIEN repositories

Brought by drakestapleton

branch main Branches Tags History

omega-harness / examples / mistake_bound_input.om

24 lines · 530 bytes Raw Blame History
1note mistake_bound_input: a bound is a trap, not a clamp. scan counts letters with bound 70; the 111
2note letters stand for outside input (a request line, a file, a database row): pass 71 traps 4, exit 104.
3note The fix is bound_input_guard.om: stop below the bound, or check the length before the loop.
4global b uchar 128
5fn scan e ulong to ulong
6q = ulong 0
7while lt q e bound 70
8if ne get b q 65
9break
10end
11q = add q 1
12end
13ret q
14end
15fn main to int
16for i ulong 111
17put b i 65
18end
19r = scan ulong 111
20if eq r 0
21ret 0
22end
23ret 1
24end