pcs: Use emsRepf rather than emsSetnc+emsRep
pcs: Fix compiler warning

    if ( buf = malloc() )

needs to be

    if ( (buf = malloc() ) )

so that you convince the compiler that you understand that you
are not meaning to use ==