you can use the following modifcation
\newlength{\lstcolumnwidth} \settowidth{\lstcolumnwidth}{\ttfamily M} \lstset{basicstyle=\ttfamily,basewidth=\lstcolumnwidth,columns=fixed, fontadjust=true} The indention at the beginning of line isn't a problem by LaTeX. This is a problem of the reader. There are no settings for such case. You can get an odd solution with the following code:
\lstset{showspaces=true} \makeatletter \def\lst@visiblespace{\textcolor{codebg}{-}} \makeatother With packages like attachefile2attachefile2 you can attach the original c-file.