DMM na RS232C

Robert Kania konference at gdi.cz
Fri Sep 10 17:20:57 CEST 2004


Igor Cerny wrote:
> dival jsem se na to, ale bohuzel nejsem schopen to z kompilovat :(
> 

Dival jsem se na to opravdu jen velmi zbezne, snad by mohl pomoct tento 
patch:

--- multimeter.c.orig	Sat Jun 15 22:23:07 2002
+++ multimeter.c	Fri Sep 10 17:15:09 2004
@@ -114,7 +114,7 @@
      }; break;

      case 'i': {
-      if (i+1<argc) {stpncpy( (char *) port, argv[++i],14 ); port[14]='\0';
+      if (i+1<argc) {memcpy( (char *) port, argv[++i],14 ); port[14]='\0';
        } else return usage(argv[0]);
      }; break;

@@ -154,7 +154,7 @@

      case 'o': {
        if (i+1<argc) {
-        stpncpy( (char *) outfilename, argv[++i],254 ); port[254]='\0';
+        memcpy( (char *) outfilename, argv[++i],254 ); port[254]='\0';
          if ( (outfile=fopen( (char *) outfilename,"w")) == NULL  ) {
            fprintf(stderr,"Error opening file.\n");
            usage(argv[0]);





r/



More information about the Users-l mailing list