Rainer Deyke Wrote: > Jeremie Pelletier wrote: > > bearophile Wrote: > >> - if(de.name[$-2 .. $] == ".c") is a bit unsafe, (...) > > I don't see how unsafe that is in this context. > > Potential buffer underrun. > http://www.digitalmars.com/d/1.0/arrays.html: "A program may not rely on > array bounds checking happening" > > > -- > Rainer Deyke - rain...@eldwood.com
Oh yeah, didn't think about that one here. I usually test for the string length before slicing it.