TeehanLax/node-carrot2 — pull request #2 by mef (2013-01-18 19:04:12+00:00)
Title: malformed request when max option is not defined

Example from README.md (basic use, step 4) used to crash the process, whereas running examples.basic.js worked fine.

It turned out that this was because when option "max" is omitted, the XML did not encode any document, as variable length only got defined when max exists.

Attached code fixes this by defining the variable length when max is not set.