[prev] 4 [next]

Assignment 1 Review (cont)

Common errors ...
  • struct Email { char *local; char *domain; }
    • tuple data must be stored within the struct
  • buffers of size 128  (should be 129, unless storing length)
  • sscanf(str, "[^@]@[^@]", locBuf, domBuf)
  • or even a regex like "[A-Za-z0-9.-]+@[A-Za-z0-9.-]+"
  • internallength = ?  in create type EmailAddress
    • needs to match sizeof struct Email  (unless varlen)
  • memory leaks (e.g. not freeing regex buffers)
  • thinking that 20 tuples is going to use indexing
Debugging server errors can be tedious (fprintf to log file)