X-Git-Url: http://git.mutantstargoat.com/user/nuclear/?a=blobdiff_plain;f=src%2Fdatamap.cc;h=1f3befeada97e3107352251666091250b2f489e0;hb=68e71418a70dab4174981d5a579e96a9089f8682;hp=e466082ec0949500bbe5b47c1b8732cf21be396a;hpb=b30241a8a51be904b22459a1d0cc3322e0a505d9;p=laserbrain_demo diff --git a/src/datamap.cc b/src/datamap.cc index e466082..1f3befe 100644 --- a/src/datamap.cc +++ b/src/datamap.cc @@ -93,7 +93,12 @@ int DataMap::lookup(const char *in, char *buf, int bsz) const char *inbuf = (char*)alloca(strlen(in) + 1); strcpy(inbuf, in); - in = clean_line(inbuf); + if(!(in = clean_line(inbuf))) { + if(buf && bsz > 0) { + buf[0] = 0; + } + return 0; + } // first check the cache std::map::iterator it = cache.find(in);