Skip to content
Snippets Groups Projects
Commit 7c3379ca authored by Bernard Blackham's avatar Bernard Blackham
Browse files

fix stupid crypto bug

parent c76c74d4
Branches
Tags
No related merge requests found
......@@ -44,6 +44,7 @@ class VendingMachine:
except socket.error:
raise VendingException('failed to read input from vending machine')
if s == '': raise VendingException('nothing read!')
if (s != '#' and s != '%') and state == 1: prefix += s
if s == '\n' or s == '\r':
state = 1
prefix = ''
......@@ -114,7 +115,7 @@ class VendingMachine:
def vend(self, item):
if not re.search('^[0-9][0-9]$', item):
return (False, 'Invalid item requested (%s)'%item)
self.wfh.write(self.authed_message(('V%s\n'%item)+'\n'))
self.wfh.write(self.authed_message(('V%s'%item))+'\n')
(code, string) = self.get_response()
return (code == '100', code, string)
......
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment