diff --git a/fdt_matrix_ops.cc b/fdt_matrix_ops.cc
index d7f0df82d270abafbf644748f9dd89ff566baf90..19d77283c0f53ffc11d016b5b945345570ac5c8d 100644
--- a/fdt_matrix_ops.cc
+++ b/fdt_matrix_ops.cc
@@ -14,7 +14,7 @@ using namespace NEWIMAGE;
 using namespace NEWMAT;
 
 string matf2coordf(string matf){
-  unsigned int pos=matf.rfind("/");
+  int pos=matf.rfind("/");
   if(pos!=string::npos)
     matf.replace(pos,1,"/coords_for_");
   else