git.ucc.asn.au
/
tpg
/
opendispense2.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
More cleanup, implementing `dispense give`
[tpg/opendispense2.git]
/
src
/
cokebank_basic
/
bank.c
diff --git
a/src/cokebank_basic/bank.c
b/src/cokebank_basic/bank.c
index
d78f90f
..
dce089f
100644
(file)
--- a/
src/cokebank_basic/bank.c
+++ b/
src/cokebank_basic/bank.c
@@
-24,7
+24,7
@@
enum {
};
// === PROTOTYPES ===
};
// === PROTOTYPES ===
-static int GetUnixID(const char *
N
ame);
+static int GetUnixID(const char *
Usern
ame);
// === GLOBALS ===
tUser *gaBank_Users;
// === GLOBALS ===
tUser *gaBank_Users;
@@
-32,13
+32,16
@@
tUser *gaBank_Users;
FILE *gBank_File;
// === CODE ===
FILE *gBank_File;
// === CODE ===
-int Bank_GetUserBy
UnixID(int UnixID
)
+int Bank_GetUserBy
Name(const char *Username
)
{
{
- int i;
+ int i, uid;
+
+ uid = GetUnixID(Username);
+
// Expensive search :(
for( i = 0; i < giBank_NumUsers; i ++ )
{
// Expensive search :(
for( i = 0; i < giBank_NumUsers; i ++ )
{
- if( gaBank_Users[i].UnixID ==
UnixID
)
+ if( gaBank_Users[i].UnixID ==
uid
)
return i;
}
return i;
}
UCC
git Repository :: git.ucc.asn.au